Server-side DataTable Sorting in RichFaces

Posted by sblundy on Stack Overflow See other posts from Stack Overflow or by sblundy
Published on 2008-09-25T17:34:26Z Indexed on 2010/05/11 21:54 UTC
Read the original article Hit count: 813

Filed under:
|
|
|

I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header.

<rich:datascroller for="instanceList" actionListener="#{pageDataModel.pageChange}"/>
<rich:dataTable id="instanceList" rows="10" value="#{pageDataModel}"
                var="fieldValues" rowKeyVar="rowKey">
  <rich:columns value="#{pageDataModel.columnNames}" var="column" index="idx">
    <f:facet name="header">
      <h:outputText value="#{column}"/>
    </f:facet>          
    <h:outputText value="#{classFieldValues[idx]}" />
  </rich:columns>
</rich:dataTable>

I already have a method on the bean for executing the sort.

public void sort(int column)

© Stack Overflow or respective owner

Related posts about java

Related posts about AJAX