For exmaple:
List bigList = new ArrayList();
List companiesList = new ArrayList();
List employees = new ArrayList(); employees.add(new Employee(...)); employees.add(new Employee(...)); employees.add(new Employee(...));
companiesList.add( employees )
List employees2 = new ArrayList(); employees2.add(new Employee(...)); employees2.add(new Employee(...)); employees2.add(new Employee(...));
companiesList.add( employees2 )
//do above for another companiesList2
bigList.add( companiesList1 ); bigList.add( companiesList2 );
How do you set up an input box to handle updating an Employee in a Company in the masterList
testForm.bigList[1][2][0].lastName //2nd company in bigList, 3rd list of employees, 1st employee
Daniel Lobo wrote the following on 5/3/2005 6:19 AM:
Hi,
I have an action form with a map that can be accessed with getters and setters. That map holds lists of elements. The problem is how to populate that lists from the html form . I've tried with:
<input name="elementsMap(0).[0]" value="foo">
and
<input name="elementsMap(0)[0]" value="foo">
but doesn't work.
However, i've implemented a new class child of ArrayList that adds this two methods:
public List getList() { return this; } public void setList(List list) { clear(); addAll(list); }
And using this class in the map I can do from javascript:
<input name="elementsMap(0).list[0]" value="foo">
And the population of the ActionForm works properly. żDoes somebody know how to fix this problem without the use of this two "ugly" methods?
Thanks.
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Rick
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]