1 Reply Latest reply on Oct 2, 2008 1:11 PM by Pete Muir

    Trouble with s:selectItems noSelectionLabel attribute in h:selectManyListbox

    Daniel Behrwind Newbie

      Hi,


      I got the following h:selectManyListbox:



      <h:form>
          <rich:simpleTogglePanel switchType="client" label="Filter log entries" opened="false" rendered ="#{not empty analysisServerLogs}">
              <s:decorate id="valueDecoration1" template="../../layout/edit.xhtml">
                  <ui:define name="label">Hosts:</ui:define>
                  <h:selectManyListbox value="#{analysisServerLogHandler.selectedHosts}" size="3" required="true">
                      <s:selectItems value="#{logHosts}" var="host" label="#{host}" noSelectionLabel="-- none --" />
                  </h:selectManyListbox>
                 </s:decorate>
              <h:commandButton value="Filter" action="#{analysisServerLogHandler.doFilter}" />
          </rich:simpleTogglePanel>
      </h:form>



      When I submit the form with the noSelectionLabel (that is -- none --) selected I get the a NPE even though the h:selectManyListbox is required="true":


      javax.faces.FacesException
              at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:108)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
              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(Thread.java:619)
      Caused by: java.lang.NullPointerException
              at javax.faces.component.UISelectMany.matchValue(UISelectMany.java:496)
              at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:454)
              at javax.faces.component.UIInput.validate(UIInput.java:867)
              at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
              at javax.faces.component.UIInput.processValidators(UIInput.java:666)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIForm.processValidators(UIForm.java:229)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
              at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
              at org.ajax4jsf.component.AjaxViewRoot.access$201(AjaxViewRoot.java:57)
              at org.ajax4jsf.component.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:319)
              at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:56)
              at org.ajax4jsf.context.AjaxContextImpl.invokeOnRegionOrRoot(AjaxContextImpl.java:170)
              at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:333)
              at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
              ... 40 more



      Am I facing a bug or am I doing something wrong?


      Thanks!