users
[Top] [All Lists]

Struts double indexed list posting

To: "CinJug" <users@xxxxxxxxxx>
Subject: Struts double indexed list posting
From: "Edward Sumerfield" <esumerfd@xxxxxxxxxxx>
Date: Thu, 19 Jun 2003 17:45:23 -0400
Delivered-to: mailing list users@cinjug.org
Mailing-list: contact users-help@cinjug.org; run by ezmlm
I have a form that contains a list of lists of maps to correspond to rows, columns and cell data.
 
Bean
 
List rowList = new ArrayList();
List cellList = new ArrayList();
Map cellInfo = new HashMap();
 
cellList.add(cellInfo);
rowlist.add(cellList);
 
JSP
 
<logic:iterate id="row" name="bean" property="rowList">
    <logic:iterate id="cell" name="row" property="cellList">
 
        <html:text name="cell" property="cellInfo(somedata)"/>
 
    </logic:iterator>
</logic:iterator>
 
Problem
 
The page renders just fine but I cant work out how to post the data back to the form on the server again.
 
Adding indexed="true" to the html:text field produces cell[0].cellInfo(somedata) but that repeats for each row since it is not including the outer look index.
 
I should be able to add the indexId="rowId" onto the first iterate to get the actual index but what format would I need in the html:text property field to make if call the right setter on the form. Can it be mapped to setCellInfo(int, int, value) by any chance?
 
The struts indexed access doc only talks about single index arrays.
 
Any ideas?
 
Ed
 
<Prev in Thread] Current Thread [Next in Thread>