1 Reply Latest reply on Nov 11, 2011 3:22 AM by Konstantinos Tsartsaros

    JBoss RichFaces: listShuttle problem

    Marco Santos Newbie

      Hello there!


      Im trying to use the listShuttle to add roles to a User Entity, but im getting problems when when i execute the action to persist the user.


      As far as i understood, the var attribute on the listShuttle RichFaces component is used as a list and to get the value to the columns on the selection tables. When i  execute the command registerUser i get this exception:


      javax.faces.FacesException: javax.el.PropertyNotFoundException: /registerUser.xhtml @42,63 value="#{rolesShuttle.name}": Property 'name' not found on type java.lang.String
           at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.richfaces.renderkit.ListShuttleRendererBase.encodeOneRow(ListShuttleRendererBase.java:182)
           at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:86)
           at org.richfaces.model.ListShuttleDataModel.walk(ListShuttleDataModel.java:57)
           at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:1151)
      


      here is the xhtml file;


      <ui:define name="body">
      
          <rich:panel>
              <f:facet name="header">registerUser</f:facet>
      
              <h:form id="registerUserForm">
                     <div class="dialog">
                          <h:panelGrid columns="4" rowClasses="prop"
                               columnClasses="name,value,nameRigth,valueRigth">
                               
                               <h:outputLabel for="name" value="#{messages['registerUser.name']}" />
                               <h:inputText id="name" value="#{registerUser.name}" required="true" />
      
                               <h:outputLabel for="password" value="#{messages['registerUser.password']}" />
                               <h:inputSecret id="password" value="#{registerUser.password}" required="true" />
      
                               <h:outputLabel for="mail" value="#{messages['registerUser.mail']}" />
                               <h:inputText id="mail" value="#{registerUser.mail}" required="true" />
      
                               <h:outputLabel for="fullName" value="#{messages['registerUser.fullname']}" />
                               <h:inputText id="fullName" value="#{registerUser.fullName}" required="true"/>
                               
                               <rich:listShuttle 
                                    var="rolesShuttle" listHeight="300" listWidth="200" 
                                    sourceCaptionLabel="Available Items"
                                    sourceValue="#{registerUser.rolesList}"
                                 targetCaptionLabel="Currently Active Items"
                                 targetValue="#{registerUser.rolesSelection}">
                       
                                 <rich:column>
                                     <h:outputText value="#{rolesShuttle.name}"></h:outputText>
                                 </rich:column>
                             </rich:listShuttle>
      
                          </h:panelGrid>
                     </div>
                  <h:commandButton id="registerUser" value="registerUser!" action="#{registerUser.registerUser}"/>
      
              </h:form>
      
          </rich:panel>
      
      </ui:define>
      
      </ui:composition>
      



      Why when the page is rendering there is no problem with value rolesShuttle.name, but when is executing the action a exception is raised?


      Thanks a lot!