0 Replies Latest reply on Jul 15, 2008 4:15 PM by Saravanan Vijayappan

    Question in dataOrderedList

    Saravanan Vijayappan Newbie

      Hi

      I wanna dynamically change the order of the dataList based on the user choice. I would create a Select input box and show the choices (Model, price, mileage etc) to the user. Is there any way to change the Order of the items in dataOrderedList without rebuilding the component tree like what we do in tableSorting ?


      <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="10">
       <h:outputText value="#{car.make} #{car.model}"/><br/>
       <h:outputText value="Price:" styleClass="label"></h:outputText>
       <h:outputText value="#{car.price} " />
       <h:outputText value="Mileage:" styleClass="label"></h:outputText>
       <h:outputText value="#{car.mileage} " />
       <h:outputText value="VIN:" styleClass="label"></h:outputText>
       <h:outputText value="#{car.vin}" />
       </rich:dataList>
      


      Result:

      * Chevrolet Corvette
       Price:30426 Mileage:20283.0 VIN:NOMWBNQZUTSTFE
       * Chevrolet Corvette
       Price:31057 Mileage:38453.0 VIN:BDCJLIJBCFFTUQQ
       * Chevrolet Corvette
       Price:54130 Mileage:17964.0 VIN:FDEQPLADPWJLKJK
       * Chevrolet Corvette
       Price:45928 Mileage:13946.0 VIN:NMXYJJONQCYEHGJ
       * Chevrolet Corvette
       Price:51465 Mileage:62520.0 VIN:PTSRLOUQTWVHGL
       * Chevrolet Malibu
       Price:46304 Mileage:54656.0 VIN:QHJKNMOOVUSBEWR
       * Chevrolet Malibu
       Price:38884 Mileage:74555.0 VIN:EEHLQKHIBCQRVDB
       * Chevrolet Malibu
       Price:26781 Mileage:15991.0 VIN:YTYVWCBQPLSVBWG
       * Chevrolet Malibu
       Price:20723 Mileage:37890.0 VIN:QNSLKFGXYRSZQNM
       * Chevrolet Malibu
       Price:53054 Mileage:39946.0 VIN:GNLXSRHGDCFOKHK


      Thanks,
      Sarav