Hi Alec,

If I understand what you want to do, you're trying to iterate over two collections at 
the same time, and not over nested
ones. That can't be done in Struts now.

However, you can modifiy the html code to do something like this:

<table>
<tr><td>
    <table>
    <logic:iterate id="cols" name="status" property="cols" scope="request">
        <tr><td><bean:write name="cols"/></td></tr>
    </logic:iterate>
    </table>
</td><td>
    <table>
    <logic:iterate id="rows" name="status" property="rows" scope="request">
        <tr><td><bean:write name="rows"/></td></tr>
    </logic:iterate>
    </table>
</td></tr>
</table>

Hope this help,

Jean-Noel

----- Original Message -----
From: Alex Colic <[EMAIL PROTECTED]>
To: Struts <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 3:26 PM
Subject: Help simple Iteration question?


> Hi,
>
> I hope someone can help with the iterate tag. I have a question regarding
> nested iteration and struts.
>
> I have a request object, 'status', that has two properties, rows and cols.
> Each of these properties is an array of strings. I am trying to create an
> html table from these two properties.
>
> Obviously the below is wrong. I am trying to set-up the table so that column
> one is printed first than the value for row one, than a new row.
>
> e.g.
> col1, row1
> col2, row2
> col3, row3
>
> Any idea how I could structure this nested iteration?
>
> Any help is appreciated.
>
> Alex
>
> <logic:iterate id="cols" name="status" property="cols" scope="request">
> <logic:iterate id="rows" name="status" property="rows" scope="request">
>       <TR>
>         <TD><bean:write name="cols" /></TD>
>          <TD><bean:write name="rows"/></TD>
>       </TR>
>   </logic:iterate>
> </logic:iterate>
>
> Regards
>
> Alex
>
>

Reply via email to