There was indeed a change made recently related to the current iteration
index. However, the change made the index available only to nested custom
tags. It was not exposed as a scripting variable, nor was it made accessable
through any other Struts tag, as far as I can determine.

It seems to me that exposing the index as a scripting variable, named by an
attribute of either the iterate tag or a new iterateIndex tag, would be a
useful thing. I might even write this if other people think it would be
useful...

--
Martin Cooper


----- Original Message -----
From: "Jim Richards" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 7:24 PM
Subject: Re: Indexed Grid Representation on a Form


>
> It should be:
>
>          <% int i = 0; %>
>          <logic:iterate id="list" name="adminUpdateProfileForm"
property="customerContacts">
>             <tr> <% i++ ; %>
>              <td><html:text property="<%= \"customerContact[\" + i
\"].contactName\" %>"/></td>
>             </tr>
>          </logic:iterate>
>
> You need to replace the whole string. The exception would have been from
> the BeanUtils not able to understand what the [i] would have meant. If you
> have an iterator in a scriptlet, then you need to always use a scriptlet
> to access it. Usually. Mostly.
>
> I had a feeling there was a change made to iterate recently to give you
> an index value, but I can't remember what it was.
>
> I usually use a Map and have the key as the integer value in the index
> for the entry. Works well when you don't have liner numbering in the
> list of key/value pairs.


Reply via email to