Is it possible to access the idx variable in a scriplet during iteration?

-----Original Message-----
From: Quentin.Cope [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 11:54
To: Struts Users Mailing List
Subject: RE: iterate tag - can you set an increment?


Andy

How about

<logic:iterate id="idx" name="myBean" property="array" scope="session"
indexId="index">
        <tr>
                <logic:iterate id="idrow" name="myBean" property="array" 
scope="session"
offset="index" length="2">
                        <td><bean:write name="idrow" property="long_desc"/></td>
                </logic:iterate>
        </tr>
</logic:iterate>

Quentin



-----Original Message-----
From: Andy Kriger [mailto:[EMAIL PROTECTED]]
Sent: 19 November 2002 16:44
To: Struts Users Mailing List
Subject: iterate tag - can you set an increment?


Is there any way to set an iteration increment on the iterate tag? For
example, iterate through the array returning every 2nd item.

If not, can anyone tell me how I might do this without resorting to
scriplets (or only using them minimally)? Here's the code I'm trying to use.
The first TD is the long_desc field of array[idx] in myBean. How can I
increment idx so I can get the next item? (maybe I'm being slow since I
haven't had my coffee yet)

<logic:iterate id="idx" name="myBean" property="array" scope="session">
        <tr>
        <td><bean:write name="idx" property="long_desc"/></td>
        <td><bean:write name="???" property="long_desc"/></td>
        </tr>
</logic:iterate>

thx
andy



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to