5 Replies Latest reply on Jul 27, 2009 8:40 PM by Brett Williamson

    scrollableDataTable initial sort value

    Brett Williamson Newbie

      Hello,
      I'm having a problem with rich:scrollableDataTable. All I want to do is specify a column to render in DESCENDING order... very simple but I can't get it to work the table is declared as follows:


      <rich:scrollableDataTable id="${id}notesTable" var="note"
       value="${noteActionEntity.notes}"
       selection="${noteActionEntity.noteSelection}"
       binding="${noteActionEntity.noteDataTable}" sortMode="single"
       selectionMode="single" height="290px" width="720px">
      
      
       <rich:column width="180px" styleClass="centre" sortExpression="noteSourceParty.formalPartyName">
       <f:facet name="header">
       <h:outputText value="#{messages.noteLodgedByLabel}" />
       </f:facet>
       <t:outputText value="${note.noteSourceParty.formalPartyName}" />
       </rich:column>
       <rich:column width="160px" styleClass="centre" sortExpression="messageDate" sortOrder="DESCENDING">
       <f:facet name="header">
       <h:outputText value="#{messages.noteDateLodgedLabel}" />
       </f:facet>
       <h:outputText value="${note.messageDate}" />
       </rich:column>
       <rich:column width="256px" sortExpression="messageText">
       <f:facet name="header">
       <h:outputText value="#{messages.messagePreviewLabel}" />
       </f:facet>
       <t:outputText value="${note.messageText}" />
       </rich:column>
       <rich:column width="100px" sortExpression="messageAck">
       <f:facet name="header">
       <h:outputText value="#{messages.acknowledgedLabel}" />
       </f:facet>
       <t:outputText value="${note.messageAck}" />
       </rich:column>
      </rich:scrollableDataTable>
      
      
      I am trying to get the noteLodged column to sort descending on start up but it always sorts ascending. NOte the use of the sortExpression and the sortOrder attributes. A click on the header works fine to toggle the sort.
      
      Thanks for any help.
      
      Brett