This example demonstrates the sorting feature for the RichFaces table components.

The object property which is used for sorting should be defined for each column with the sortBy attribute.

Use the sortOrder attribute together with user actions to determine the sorting order. Alternatively, you can use #{rich:component('tableId')}.sort('columnId', ['sortOrder']) with the JavaScript API.