8 Replies Latest reply on Feb 17, 2011 1:58 AM by darcy george

    Sortorder in column sorting of extendedDataTable in Richfaces 4 M5

    darcy george Newbie

      Hi to everybody,

       

      I'm new to JSF and especially to RichFaces. My Environment is Eclips Galileo-SR2-Bundle, Richfaces 4 M5 and Tomcat 6.

       

      I'm trying extendedDataTable with column sorting. I have refered demo: 

      http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?sample=tableSorting&demo=dataTable&skin=blueSky

       

      In the demo, for sorting a column, they have used the following code.

       

      <rich:column sortBy="#{cap.name}" id="name"

                      sortOrder="#{capitalsSortingBean.capitalsOrder}">

                      <f:facet name="header">

                          <a4j:commandLink value="Sort by Capital Name" render="table"

                              action="#{capitalsSortingBean.sortByCapitals}" />

                      </f:facet>

                      <h:outputText value="#{cap.name}" />

      </rich:column>

       

       

      sortOrder is changed using "capitalsSortingBean.capitalsOrder".

       

      Suppose if I have 10 columns to sort, then from the above example what i understood was to create a bean with all those 10  sortorder attributes to be sorted. and write methods to change the sort order. Can't we do some thing like, if first time it is sorted in Ascending order, then when i clicked on column header to sort, it should sort the column in the descending order. with out creating a bean with methods to handle the  changing the sort order. 

       

      Is it possible in Richfaces 4 M5?.

       

      Thanks in advance....