In case the answer is positive ("yes, this is a bug and not expected
behaviour"), I hereby attach a patch to solve it.
Tested with the html:radio tag, and it should work for all tags that
extend BaseHandlerTag (which, I presume but did not check, will be all
tags that can be indexed)
Let me know what you think about it,
tomK
> -----Original Message-----
> From: Tom Klaasen (TeleRelay)
> Sent: woensdag 31 oktober 2001 17:09
> To: Struts Developers List
> Subject: nested iterates and the indexed attribute
>
>
> Hi all,
>
> I think I discovered a bug in struts (nightly build 20011018):
>
> when I use nested iterates, the indexed attribute is always
> referring to
> the innermost iterate index, not the one which name is specified.
>
> so when I do
>
> <logic:iterate id="beanprop" name="bean" property="props">
> <logic:iterate id="beanpropinner" name="beanprop"
> property="inner">
> <html:radio name="beanprop" property="someIndex"
> value="someValue" indexed="true"/>
> </logic:iterate>
> </logic:iterate>
>
> I get something like
>
> <input type="radio" name="beanprop[0].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[2].someIndex" value="someValue">
> <input type="radio" name="beanprop[0].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[2].someIndex" value="someValue">
> <input type="radio" name="beanprop[3].someIndex" value="someValue">
> <input type="radio" name="beanprop[4].someIndex" value="someValue">
>
> instead of the expected
>
> <input type="radio" name="beanprop[0].someIndex" value="someValue">
> <input type="radio" name="beanprop[0].someIndex" value="someValue">
> <input type="radio" name="beanprop[0].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
> <input type="radio" name="beanprop[1].someIndex" value="someValue">
>
> (watch the indexes)
>
> (Of course, "someValue" would be replaced by something that
> is computed
> and makes more sense. This computation is omitted here for simplicity)
>
> Now, should I in fact consider this a bug and try to solve this, or do
> you think this is expected behaviour?
>
>
> thanks,
> tomK
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-dev-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>
>
BaseHandlerTag.java.diff
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>