|
Whitebeam Template Reference Documentation
|
Iterator Template
getNextRow()
Get the data from the next row.
Syntax
bool = rb.iterator.getNextRow()
Parameters
The 'getNextRow' method takes no parameters
Results
The 'getNextRow' method returns bool:
Type/Value | Range/Length | Description |
bool |
  |
Returns 'true' if the method found another row in the table, 'false' if the end of the table has been reached.
|
Remarks This method loads the iterator with property values for the next row in the table. If this
is the first operation on the iterator since it was created then the method will return the
first row in the table. The initial or current position in a table can be modified using
iterator.setNextRow(). The return value from the method indicates whether new row values were available - or whether
the end of the table had been reached. Example This example uses the rb.page.iterateHeader
to create an iterator and then steps through each row in the virtual table - in this case each row represents
one of the HTTP headers provided by the client.
rb.page.write('<h1>HTTP Headers</h1>\n');
var iter = rb.page.iterateHeader();
rb.page.write('<table border="1">\n');
while (iter.getNextRow()) {
rb.page.write('<tr><td>'+iter.name+'</td><td>'+iter.value+'</td></tr>\n');
}
rb.page.write('</table>\n');
The typical output produced by this code fragment would be as follows: HTTP HeadersAccept | */* | Accept-Encoding | gzip, deflate | Accept-Language | en-gb | Connection | Keep-Alive | Cookie | Red60urne=TestContextId | Host | client1 | User-Agent | Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) |
|
|
(loadtime : 21ms) |