posted 18 years ago
Hi, I have the same problem as the question below. Anyone has the solution other than using plain JSTL two <c:Foreach>?
I have a nested loop using nested:iterate. Inside the inner loop I have a
radio button. I want to group the radio buttons based on the index of the
outer loop. How can I do it?
Here's the code snapshot:
<nested:iterate property="outerProp" > OuterProperty:
<nested:iterate id="row" property="innerProp"
type="java.my.someType"> InnerProperty:
<nested:radio name="row" property="selectedId"
value="myId" indexed="true" /> My Radio Property
</nested:iterate>
<nested:iterate>
With the indexed="true", my radio buttons are being rendered, for example,
like this:
OuterPropety0:
InnerProperty0: row[0].selectedId
InnerProperty1: row[1].selectedId
InnerProperty2: row[2].selectedId
OuterPropety1:
InnerProperty0: row[0].selectedId
InnerProperty1: row[1].selectedId
InnerProperty2: row[2].selectedId
Whereas, I want it to be like this:
OuterPropety0:
InnerProperty0: row[0].selectedId
InnerProperty1: row[0].selectedId
InnerProperty2: row[0].selectedId
OuterPropety1:
InnerProperty0: row[1].selectedId
InnerProperty1: row[1].selectedId
InnerProperty2: row[1].selectedId
Thanks,
Andy