Help coderanch get a
new server
by contributing to the fundraiser

K. E. Kerks

Greenhorn
+ Follow
since Jan 04, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by K. E. Kerks

Thanks for your suggestion. However, it did not work for me.

My solution was to change the inner logic:iterate to a nested:iterate, which then successfully looped through the causes array.

Thanks, again.
19 years ago
Thanks. I'll look at the references you provided and see if I can figure it out.
19 years ago
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!
19 years ago