3 Replies Latest reply on Aug 12, 2008 2:29 PM by Charles Caron

    Selectoneboxlist doesn't work

    moumen rajae Newbie

      Im trying to make a simple selectonelistbox and i have a Invalid byte 2 of 3-byte UTF-8 sequence i'm sure its a newbie mistake but i can't see it thanks for your help



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:s="http://jboss.com/products/seam/taglib"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:rich="http://richfaces.org/rich"
                      template="layout/template.xhtml">
      
      <ui:define name="body">
          
          <h:messages styleClass="message"/>
          
          <h:form id="login">
          
              <rich:panel>
                  <f:facet name="header">Request</f:facet>
          
                 
                  <div class="request">
                   <p>Veuiilez saisir votre demande <p/>
                      <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value">
                          <h:selectOneListbox  required="yes">
                         
                       <f:selectItem id="1" itemLabel="Attestation de travail" itemValue="a-trav"></f:selectItem>
                       <f:selectItem id="2" itemLabel="Attestation de stage" itemValue="a-stage"></f:selectItem>
                       <f:selectItem id="3" itemLabel="Attestaion de salaire" itemValue="a-sal"></f:selectItem>
                       <f:selectItem id="4" itemLabel="Contract d'engagement" itemValue="c-engag"></f:selectItem>
                       <f:selectItem id="5" itemLabel="Demande de congé" itemValue="d-cong"></f:selectItem>
                       <f:selectItem id="6" itemLabel="Ordre du jour" itemValue="o-jour"></f:selectItem>          
                       <f:selectItem id="7" itemLabel="Chèque d'engagement" itemValue="c-engag"></f:selectItem>
                       <f:selectItem id="8" itemLabel="Ordre de mission" itemValue="o-mission"></f:selectItem>
              </h:selectOneListbox>
                      </h:panelGrid>
                  </div>
                      
              </rich:panel>
          </h:form> 
       </ui:define> 
      </ui:composition>
      


        • 1. Re: Selectoneboxlist doesn't work
          Charles Caron Newbie

          It's because of the string Demande de congé. You must use the UTF-8 code for the é character.

          • 2. Re: Selectoneboxlist doesn't work
            moumen rajae Newbie

            Thakns very much,i don't have this error anymore bue i have an other error that i don't understand the error is 1
            here is the stack trace



            java.lang.IllegalArgumentException: 1
                 at javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:529)
                 at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
                 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:151)
                 at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                 at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
                 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
                 at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
                 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
                 at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                 at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
                 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
                 at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
                 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
                 at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                 at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
                 at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
                 at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)
                 at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)
                 at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
                 at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                 at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                 at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
                 at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                 at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
                 at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
                 at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
                 at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
                 at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
                 at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
                 at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
                 at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
                 at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
                 at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                 at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                 at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                 at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                 at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                 at java.lang.Thread.run(Unknown Source)



            • 3. Re: Selectoneboxlist doesn't work
              Charles Caron Newbie

              This one speaks for itself, you cannot give the component f:selectItem an id of 1, 2, 3 or whatever number. Use a string like option1.