Data that makes sense when displayed in a spreadsheet (or a tabular structure) is known as tabular data. In web applications, tabular data is commonly obtained from databases, where the data is natively represented in relational tables. The main JSF component for displaying tabular data is represented by the <h:dataTable>
tag, which is capable of producing HTML classical tables. This chapter is a tribute to this tag, since tabular data is very commonly used and can be manipulated in many ways. Therefore, in this chapter, you will learn about the following topics:
Creating a simple JSF table
The
CollectionDataModel
class of JSF 2.2Sorting tables
Deleting a table row
Editing/updating a table row
Adding a new row
Displaying a row number
Selecting a single row
Selecting multiple rows
Nesting tables
Paginating tables
Generating tables with the JSF API
Filtering tables
Styling tables