# <netui-data:pager> Tag

This tag sets the number of records rendered on an individual page of <netui-data:grid> data and renders the navigation links for moving between pages.

## Syntax

<netui-data:pager
action="string_action"
[pageSize="integer_pageSize"]
[renderInFooter="boolean_renderInFooter"]
[renderInHeader="boolean_renderInHeader"] />

## Description

This tag sets the number of records rendered on an individual page of <netui-data:grid> data and renders the navigation links for moving between pages. The navigation links can be rendered before the <netui-data:grid> table, after the table, or both by setting the `renderInHeader`, `renderInFooter`, or both of these attributes, respectively.

The navigation links have the following default format:

        Page # of # [Prev] [Next]

The "Page # of #" phrase is computed using the current page, the page size, and the data set size. If there is no data, the pager will read "Page 1 of 1". The "Prev" and "Next" links are optional depending on the size of the data set, the current page, and the page size. The rules are:

> - If the first page is being rendered, the "Prev" link is not shown.
> - If the last page is being rendered, the "Next" link is not shown.
> - If there is only one page of data to render, neither link is shown.

## Attributes

action | The action method that will be invoked if by the navigation links. This attribute is required. If the Page Flow has been automatically generated from a RowSet control, the action method `pageAction` is provided by default:
         /**
          * @jpf:action
          * @jpf:forward name="page" path="grid.jsp"
          */
          public Forward pageAction()
              throws Exception
          {
              sortFilterService = SortFilterService.getInstance(getRequest());
              return new Forward("page");
          }
Required | Supports runtime expression evaluation | Data bindable
Yes | No | No
pageSize | Integer. The number of data rows that will be displayed in a <netui-data:grid> The default value is 10 rows.
Required | Supports runtime expression evaluation | Data bindable
No | No | No
renderInFooter | Boolean. If set to true, the navigational links render at the bottom of the table. The default value of this attribute is true.
Required | Supports runtime expression evaluation | Data bindable
No | No | No
renderInHeader | Boolean. If set to true, the navigational links render at the top of the table. The default value of this attribute is false.
Required | Supports runtime expression evaluation | Data bindable
No | No | No

## Sample

This sample shows a <netui-data:grid> tag that will render 5 items per page. Links to other pages will appear in the header and footer.

        <netui-data:grid dataSource="{pageFlow.allRows}" name="{pageFlow.gridName}">
            <netui-data:gridStyle styleClassPrefix="gridStyle"/>
            <netui-data:pager pageSize="5" renderInHeader="true" action="pageAction" renderInFooter="true"/>
            <netui-data:columns filterAction="begin" sortAction="begin">
                <netui-data:basicColumn filterable="true" title="Itemname" sortable="true" name="itemname"/>
                <netui-data:basicColumn filterable="true" title="Price" sortable="true" name="price"/>
            </netui-data:columns>
        </netui-data:grid>

## Sample Code

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/grid/grid.jsp

## Related Topics

<netui-data:grid> Tag