7 Replies Latest reply on Mar 6, 2008 12:12 AM by jessie

    rich orderingList

    Rachit Nepal Newbie

      I am new to rich faces.
      i created a orderingList with two column first coloumn has checkbox and next column has Name.
      I want to get the reorder list in controller class when it is submitted with a4j command button.
      But i am not getting it.
      How to do this.
      It threw error that the property not found.

      my view is like this:
      <rich:orderingList value="#{testForm.dimensionList}" var="list">
      <h:column>
      <h:selectBooleanCheckboxvalue="#{list.checked}"></h:selectBooleanCheckbox>
      </h:column>
      <h:column>
      <h:outputText value="#{list.dimensionName}"></h:outputText>
      </h:column>
      </rich:orderingList>
      here dimension list is list of object with two property boolean checked and String dimension name
      How to do this i want to get the reordered list in controller how is it possible
      plz help me
      Thanx in advance

        • 1. Re: rich orderingList
          Steffen Grimm Newbie

          have you added dimensionList as a property of your managed bean in the faces-config.xml?

          • 2. Re: rich orderingList
            Rachit Nepal Newbie

            thanx for quick reply
            i have not done that
            so what to do then (to add property as testForm is already a managed bean)
            gain thanking u

            • 3. Re: rich orderingList
              Rachit Nepal Newbie

              This is Dimensions.java class

              public class Dimensions {

              private boolean checked;
              private String dimensionName=null;
              ....
              with getters and setters of above properties

              }
              The List of obejcts of above class is created inside TestForm.java which is a managed bean name with name testForm
              inside getDimensionList method of TestForm
              so what i have to specify in property name and property class in faces-config.xml

              • 4. Re: rich orderingList
                Steffen Grimm Newbie

                You only need to specify the dimensionList like:


                <managed-bean-name>testForm</managed-bean-name>
                 <managed-bean-class>path.to.your.class.classname</managed-bean-class>
                 <managed-bean-scope>the scope you need</managed-bean-scope>
                 <managed-property>
                 <property-name>dimensionList</property-name>
                 <property-class>java.util.List</property-class>
                 <list-entries/>
                 </managed-property>
                 </managed-bean>
                
                


                in your bean you define the List like:

                List<Dimension> dimensionList = new ArrayList<Dimension>();


                somewhere you need to fill your list with Dimension objects. (in the construcotr or in an actionmethod that you invoke via a button on the page or whatever)

                That should be all to get it running

                • 5. Re: rich orderingList
                  Rachit Nepal Newbie

                  i have declared the list in faces-config as u suggested but my problem is not solved. It is giving me same error that property no found on type java.lang.string.
                  It is rendering when the page is loaded but as i submit the list it throws error. my requirement is to get reordered list in backing beans.
                  your help is much appreciated.
                  again thanking you.

                  • 6. Re: rich orderingList
                    Rachit Nepal Newbie

                    Update:
                    i figured out my problem
                    it is due to no converter so we should add custom converter

                    • 7. Re: rich orderingList
                      jessie Newbie

                      hi,rnepal,could you tell me how to write the converter?