Paginating tables

When you need to display large tables (with many rows), it can be useful to implement a pagination mechanism. There are many advantages, such as its fancy look, the clear presentation of data, saving space in web pages, and lazy loading.

In a standard version of such a table, we should be able to navigate to the first page, last page, next page, previous page, and in some tables, to select the number of rows displayed on one page.

When you bind a table to its backing bean, you have access to three handy properties, which are listed as follows:

  • first: This property represents the first row number that is displayed in the current table page (it starts from the default value 0). The value for this property can be specified using the ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.