Paging Options

When results are large, more records are displayed than can easily be displayed on a screen. Result Sets have paging features that allow you to control how many records appear on a page, and how to navigate between pages of records. The following tags can be used to control paging features with the Result Set tag.

Start= Row to start Page from.
MaxRows= Maximum number of rows to display per Page.

Note: These parameters are overridden by parameters already specified in a Data Formatter request.

 

MaxRows

The maximum number of rows to be displayed within a result set can be set by using the MaxRows parameter:

Example:

<RESULTSET MAXROWS="3"><LOOP>
<SKIP INTERVAL="odd"><TR bgcolor="#FFAAAA"></SKIP>
<SKIP INTERVAL="even"><TR bgcolor="#FFFFFF"></SKIP>
<TD><FIELD NAME="ResultSetRow"></TD>
<TD><FIELD NAME="employeenumber"></td>
<TD><FIELD NAME="firstname"><FIELD NAME="lastname"></td>
</TR>
</LOOP>
</RESULTSET>

The employee list is now limited to three rows.

 

Navigation

To allow users to view other records, navigation elements can be added to the result set.

Back Button The following code is added to create a "Back" link. This is used to scroll backwards through a set of records. Note that DIR=Back.
<td>
<A HREF="?MOD=TEMPLATE&SRV=SQL&USELAST=true&DIR=Back">
Back</A></td>
Next Button The following code is added to create a "Next" link. This is used to scroll forwards through a set of records. Note that Dir=Next.
<td>
<A HREF="?MOD=TEMPLATE&SRV=SQL&USELAST=true&DIR=Next">
Next</A></td>
Current Page The following code is added to display the current page and total number of pages.
<td>Page <b>
<FIELD NAME="CurrentPage"></b>
 of <b>
<FIELD NAME="TotalPages"></b></td>

Users are able to scroll through the list of employees one page at a time by clicking on Back or OK

Example:

<RESULTSET MAXROWS="3">
<LOOP>
<SKIP INTERVAL="odd"><TR bgcolor="#FFAAAA"></SKIP>
<SKIP INTERVAL="even"><TR bgcolor="#FFFFFF"></SKIP>
<TD><FIELD NAME="ResultSetRow"></TD>
<TD><FIELD NAME="employeenumber"></td>
<TD><FIELD NAME="firstname"><FIELD NAME="lastname"></td>
</TR>
</LOOP>
<tr>
<td><A HREF="?MOD=TEMPLATE&SRV=SQL&USELAST=true&DIR=Back">Back</A></td>
<td>Page <b>
<FIELD NAME="CurrentPage"></b> of <b><FIELD NAME="TotalPages">
</b></td>
<td><A HREF="?MOD=TEMPLATE&SRV=SQL&USELAST=true&DIR=Next">Next</A></td>
</tr></RESULTSET>

Parent topic: Building Result Sets.


IBM Workplace Web Content Management - V5.1.0.1 -

 

Workplace Web Content Management is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.