To loop a list we make use of listloop
tag
IList list = ics.GetList("list_name");
int rows = list.numRows();
int cols = list.numColumns();
String columnName = "", columnValue = "";
out.println("Rows : " + rows + ", " + "Columns : " + cols + " for list " + list.getName() + " : " + list.hasData() + "<br/>");
for(int i=1; i<=rows; i++){
for(int j=0; j<cols; j++){
out.println("Is " + list.currentRow() + " last row : " + list.atEnd() + "<br/>");
columnName = list.getColumnName(j);
columnValue = list.getValue(columnName);
out.println(columnName + " : " + columnValue + "<br/>");
list.moveTo(i+1);
}
}
<ics:listloop listname="titleList">
<ics:listget fieldname="value" listname="titleList"/><br/>
<ics:listget fieldname="#curRow" listname="titleList"/><br/> // returns current row number
<ics:listget fieldname="#numCols" listname="titleList"/><br/> // returns total number of columns
<ics:listget fieldname="#numRows" listname="titleList"/><br/> // return total number of rows
</ics:listloop>
<LOOP [FROM="START"] [COUNT="LOOP_TIMES"] LIST="abc" [UNTIL="END"]>
<ICS.LISTGET LISTNAME="abc" FIELDNAME="value" OUTPUT="some_value" />
</LOOP>
#numRows |
Number of rows in this list |
#curRow |
Current row in this list. |
#moreRows |
Boolean (true/false) to indicate whether there are more rows following the current row. |
#numCols |
Number of columns in this list. |
@<colname> |
Only used on lists that contain resultsets. Contents of the file in the specified column if the colname begins with "url". |