I've been struggling with this issue all day, and I need some help. I am in no way a Struts expert and have relied on a peer and a book to get me to where I am. Please help!
I have an attribute on session (claimants), which is an ArrayList of a bean which contains several properties, one of which is another ArrayList (causes). I need to loop through claimants, rendering the instance properties (like claimant name) on a line, followed by all causes (0 to many) under the claimant name... something like this ...
JOHN DOE (property name on claim index #0)
Cause #1 (cause name on cause index #0)
Cause #2 (cause name on cause index #1)
Cause #3 (cause name on cause index #2)
JANE SMITH (property name on claim index #0)
Cause #1 (cause name on cause index #0)
Cause #2 (cause name on cause index #1)
I have this code in my jsp ...
<logic:iterate id="claimant" name="claimants" indexId="i" type="ClaimantBean" >
<TR>
<TD><IMG expand.gif"></TD>
<TD><bean:write name="claimant" property="claimantName" /></TD>
</TR>
<logic:iterate id="item" name="claimant" property="causes" type="CauseOfLossBean" />
<TR>
<TABLE border="0" cellpadding="0" cellspacing="0" width="75%">
<TBODY>
<TR class="norm8" valign="bottom">
<TD><bean:write name="item" property="lossDesc" /></TD>
</TR>
</TBODY>
</TABLE>
</TR>
</logic:iterate>
</logic:iterate>
What seems to be happening is that when the second iteration renders only one row when I know there are multiples.
Am I doing this right? I cannot use el tags, and have to rely upon Struts tag lib. I'm not even sure that's the right terminology.
Thanks in advance!