Rich Data Table has columns sorting feature built-in. The simplest way to add sorting capability is to define sortBy attribute at column you need to be sortable.

In this attribute you should define iterable object property which should be used when sorting performed.

In this example you could see that two first columns are sorted after a click on the corresponding header.

Sorting DataTable example
Details of usage

Next attributes could be defined to manage simple built-in sorting:

- sortMode - attribute of rich:dataTable which could be defined as "single"(Default) and "multiple". If multiple sorting defined - previous sorting will not be reset. Column will be sorted
- sortOrder - attribute of rich:column allows to set initial sorting on the column. (Additional ways of usage to customize sorting described at "External Sorting" tab). Possible values are "ASCENDING", "DESCENDING" and "UNSORTED"(default)
- selfSorted attribute of rich:column which defines if the table will make a header clickable and if click on the header will call sorting request. Default value is "true". In order to use custom sorting mechanism use value "false" for this attribute.