Adding paging to a data table
If your data table returns a large number of records, you can add paging options so that the user can page through the records, displaying a specified number of rows at a time. You can choose from a variety of paging formats, which enable the user to move back and forth between the pages of data.
To add paging to your data table:
- Select the data table component on a Faces JSP page.
- In the Properties view for the data table, select the Display options tab.
- In the Paging section, specify the number of rows per page.
- Click one of the following Add buttons:
- Add Web style pager creates a series of page numbers with hyperlinks to the appropriate pages.
- Add a goto pager creates a pager with a Go button and a box listing page numbers.
- Add a deluxe pager creates a pager with arrow controls for forward, back, first, and last, and text indicating "Page n of nn."
- Add a simple pager creates a pager with a Go button and a box listing next and previous page options.
The pager is created in a panel box in the footer of the data table.
- To show the total number of data records, click Add page information. A new panel box is added to the footer of the data table and it displays the total number of data records and the number currently displayed.
By default the pager is created in the data table footer. You can reposition the pager by dragging it into the header or into one of the columns. You can also reposition the pager by manually changing the source code: for example, to relocate the pager in the header, locate the facet tag surrounding the panel box that contains the pager and change facet name to top.
<f:facet name="top"> <hx:panel_box id="tjsfdgpaging1" <hx:pager_web id="tjsfdgpaging2" /> </hx:panel_box> </f:facet>
Related concepts
JavaServer Faces
Data table components
Related tasks
Creating Faces applications - overview
Adding a data table
footer. A header is displayed along the top of the data table and a footer along the bottom of the data table. You can drag other Faces components to the header and footer. For example, if you want a title for the table and an image next to the title, you can drag an Output component and an Image component to the header.">Adding a header and footer to a data table
Managing columns in a data table
Related reference
Faces components reference
Faces attributes reference