In many data-centric applications, just displaying data "as is" in a stylish table isn’t enough. Luckily, Tomahawk offers us a lot of advanced data table features, which we will explore in this section.
A very common requirement is that tables need to be sortable. A lot of users expect data to be sortable on a specific column by clicking on that column’s header. Tomahawk makes it very easy to implement a sorting feature by taking much of the work out of our hands. The simplest way to make a table sortable is by setting the sortable
attribute of the<t:dataTable>
component to true
. In this case, the<t:dataTable>
component will make every column in the table sortable. Unfortunately, this feature does not work if a Facelets composition component is used to define each column, which is the case in our example. This is due to the way the auto sorting feature is implemented in Tomahawk, as explained in the following information box.