The<tr:table>
component is a powerful component for rendering data tables. Let’s explore its possibilities by building a page similar to the one that we built in the previous chapter. The basic table definition we’re starting out with is very similar to the first table definition that we used in our Tomahawk example in the previous chapter:
<tr:table var="kid" value="#{kidsList.kids}" rows="20" id="kids">
There are some important differences that are not visible in this simple definition, though. These are as follows:
Although, in our example, the
#{kidsList.kids}
still evaluates to a simplejava.util.List
, we could have used an object of typeorg.apache.myfaces.trinidad.model.CollectionModel
instead. In fact, Trinidad will automatically convert our simpleList
to aCollectionModel
anyway.By setting
rows
to20
, Trinidad will not only limit the number of rows in the table to 20, but will also automatically add controls for navigating through the data set, should...