javajsfsortingdatatablerichfaces

Default sort column in rich:datatable


I have rich:dataTable with multiple sortable columns.

<rich:column sortBy="#{user.uid}">
...
<rich:column sortBy="#{user.sn}">
...
etc.

Sorting works fine. However, when page is loaded, table is always sorted by 1st column. How can I set "default" sorting column? (for example, the one with user.sn)

Edit: I wanted it sorted by sn first, uid second.


Solution

  • I suppose you will have to sort the underlying list. By default the table will be ordered like the list is that you pass as value.