You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Othon Reyes Sanchez <ot...@gmail.com> on 2008/03/06 00:49:36 UTC

dynamic Field Table

Hi to everyone:

I'm trying to make a tag that has an "add" button and a "remove" button.
The "add" button adds and viceversa with the remove button.
Every cell can contain only one of the following type of fields, but you can
repeat type of fields in different cells: Text, Datepicker, select, radio,
checkbox, autocompleter, label, textarea, button, hidden. TODO, drag & drop.
I had all the javascript for this stuff and even an interceptor that
recorver this data from the  params and store it in a list, but every item
of the list is a Map where the key is the name of the field and the value is
the value of the field. The resulting code is something like this
List<Map> aList = new ArrayList<Map>();
...
//every item of thwe list is filled like this
Map<String,Object> hsm = new HashMap<String,Object>();
hsm.put("A1", value);
//A represnets the first column and the number represents the row of the
field
So if the name of a field is B5, it represents the cell of the second column
and the fifth row.

What i want to do is a suggestion of how can i put the values directly to a
JavaBean instead of a Map.

Thanks for your help