1 Reply Latest reply on Nov 3, 2008 4:39 AM by ilya_shaikovsky

    sorting descending by click on icon

    ajanz

      i use a data table with sorting headers like

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       <style>
       .center{
       text-align:center;
       }
       </style>
       <h:form>
       <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="300px" columnClasses="center"
       rows="15" reRender="ds">
       <f:facet name="header">
       <h:outputText value="Sorting Example"/>
       </f:facet>
       <rich:column sortBy="#{cap.state}">
       <f:facet name="header">
       <h:outputText value="State Name"/>
       </f:facet>
       <h:outputText value="#{cap.state}"/>
       </rich:column>
       <rich:column sortBy="#{cap.name}">
       <f:facet name="header">
       <h:outputText value="State Capital"/>
       </f:facet>
       <h:outputText value="#{cap.name}"/>
       </rich:column>
       <rich:column>
       <f:facet name="header">
       <h:outputText value="Time Zone"/>
       </f:facet>
       <h:outputText value="#{cap.timeZone}"/>
       </rich:column>
       <f:facet name="footer">
       <rich:datascroller id="ds"></rich:datascroller>
       </f:facet>
       </rich:dataTable>
       </h:form>
      </ui:composition>
      
      


      when the table is rendered the headers show two icons one for ascending and one for descending. but where ever i click, the table is first sorted ascending. so it is not possible for the user to decide if he wants to sort ascending or descending.

      is there a workaround? do i something wrong?