1 Reply Latest reply on Feb 25, 2009 7:02 AM by Nick Belaevski

    <rich:orderingList> Will the component change the actual pos

    Xiubo Zhang Newbie

      Hi, I have the following codes:

      <h:form>
       <a4j:commandButton value="Save" action ="#{fareManager.save}" reRender="fareSearchResult"> </a4j:commandButton>
       <a4j:outputPanel id="fareSearchResult">
       <rich:orderingList
       value="#{fareManager.fareDatas}"
       var="fareData" listHeight="400" listWidth="500"
       selection="#{fareManager.selectedFareDatas>
       ...
       </rich:orderingList>
       </a4j:outputPanel>
      </h:form>
      


      What I am trying to achieve is:

      After the ordering list is populated by database quary, the usersmay adjust the postions of the elements in the list using the control buttons (Up, Down, Top, Buttom);

      If the user is satisfied with the changes and click the save button, the save() method in the backing bean will assign each element with a ascending sequence number (that is, the value of the "seq" attribute in the element at the top of the orderingList will be set to 0 and the second will be set to 1, etc).

      However, I don't think the List will maintain the order of the elements it holds. So, my question is:

      Is it possible to retrieve the elements in a orderingList from the backing bean in an order exactly the same with the order that the elements are displayed on the client browser?