Home > Contents > Index >
Template Tags TOC   |    Alpha TOC   |    Tag Family TOC   |    Purpose TOC   |    Annotated TOC   |    Index 

 

ics:listloop

Iterates a list.

Syntax

Parameters

listname (required)
Name of the list to iterate.

maxrows (optional)
Maximum iterations the loop should be executed. If maxrows is omitted, the loop iterates to the end of list.

startrow (optional)
Row number to start the iteration. If omitted, ics:listloop begins iterating from the current row. This attribute cannot take zero or a negative values.

endrow (optional)
Row number of the row to end the iteration. If omitted or if given a value of -1, the iteration continues to the end of list.

Error Numbers

There are no possible errno for this tag.

Example

The above code simply iterates through and prints all the 20 rows of the SystemInfo table that were retrieved by the ics:sql tag.


This code prints only the first 9 rows of the SystemInfo table because the endrow is specified to be 10.
Looping stops when the current row number becomes equal to endrow and hence the 10th row does not get printed.

This code prints the rows from 3 to 9, because we specify to start from row 3 using the startrow attribute. This attribute CANNOT be zero or negative. When startrow is equal to endrow, no rows will be output. This code uses maxrows attribute and prints out the first 10 rows of the SystemInfo table.
Unlike endrow, the maxrows attribute causes the looping to proceed until the current row number becomes greater than that specified in the maxrows attribute. Finally, when we use both endrow and maxrows, the endrow attribute takes preference and looping is stopped when the current row number equals the endrow attribute. Hence, the final code snippet will only print 9 rows, even though the maxrows attribute specifies the value 10.

See Also

ics:if

ics:listget

  Home > Contents > Index >

Oracle JSP Tag Reference
Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.