Hi all,

 

In my action form there is a 2D collection, both used ArrayList.  (i.e.
An ArrayList whose elements are ArrayList also)  I want to retrieve data
(which are all String) from the 2nd layer of the 2D collection using
<nested:text ...> tag so that it can populate the value back
automatically.  However, it is not working.

 

Code in jsp : 

 

<nested:form ...>

 

<nested:iterate id="row" property="A">

            <tr>

 <nested:iterate id="column" property="this/">

                         <td>

                                    <% System.out.println(column); %>

                                     <nested:text property="this/"
indexed="yes"/>  <!-putting indexed="yes" or not doesn't change the
result abit-->

                         </td>

</nested:iterate>

            </tr>

</nested:iterate>

 

</nested:form>

 

 

 

Result (assume a 2X2 collection with elements A1, A2, B1, B2 in them
already)

 

4 textboxes, the top 2 with [A1, A2] for both, and bottom 2 with [B1,
B2]

System.out prints out A1, A2, B1, B2 separately

 

 

It seems like the 2nd iterate tag is indeed iterating thru the 2nd layer
of the collection from the System.out statement.  But the <nested:text
.../> tag is not retrieving each element of the 2nd layer collection.
Rather, it is using the whole of the 2nd collection itself.

 

Anyone has any idea why and possibly solution ?  I would really like to
use the <nested:text .../> tag so that the values can be automatically
populated back by Struts after the user input.

 

 

Thanks in advance.

 

Louis

 

 

Reply via email to