You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Regan, Patrick" <PR...@crt.xerox.com> on 2002/06/25 15:26:58 UTC
Iterate Tag Index
I am iterating through a collection and using the indexId to display a row
or record number to the user. The index, of course is zero based (starts
with 0). Is there a simple way to make it one based (start with 1) instead?
Here is my tag code :
<logic:iterate id="row" name="queryResults" indexId="index">
<tr>
<td class="datalist" align="center"><bean:write name="index"/></td>
<td class="datalist" align="left"><bean:write name="row"
property="myProp1"/></td>
<td class="datalist" align="left"><bean:write name="row"
property="myProp2"/></td>
</tr>
</logic:iterate>
Pat
Re: Iterate Tag Index
Posted by Slava_L <lo...@esstu.ru>.
Have u found an answer ? (i'm intersted too, how to solve this problem w/o
scriptlet)
----- Original Message -----
From: "Regan, Patrick" <PR...@crt.xerox.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, June 25, 2002 10:26 PM
Subject: Iterate Tag Index
> I am iterating through a collection and using the indexId to display a row
> or record number to the user. The index, of course is zero based (starts
> with 0). Is there a simple way to make it one based (start with 1)
instead?
>
> Here is my tag code :
>
> <logic:iterate id="row" name="queryResults" indexId="index">
> <tr>
> <td class="datalist" align="center"><bean:write name="index"/></td>
> <td class="datalist" align="left"><bean:write name="row"
> property="myProp1"/></td>
> <td class="datalist" align="left"><bean:write name="row"
> property="myProp2"/></td>
> </tr>
> </logic:iterate>
>
> Pat
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>