You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Allen Lee <Al...@asu.edu> on 2009/10/01 23:17:05 UTC

dynamic collections as form inputs / tabular inputs

Is it possible to have a list of lists as a form input?  I've looked
at http://struts.apache.org/2.x/docs/tabular-inputs.html and
http://struts.apache.org/2.x/docs/tabular-inputs-with-hashmap.html but
they aren't quite capturing my needs.

I've got multiple tables of annotated data that I'd like to submit to
an action, and the OGNL syntax I'm using as the name of the form input
is something like this:

<@s.iterator status='rowStatus' value='rows' var='row'>
<@s.iterator status='columnStatus' value='columns' var='column'>
...
<@s.select name='columnEncodingTypeIds[${rowStatus.index}][${columnStatus.index}]'
listKey='id' listValue='name' list='%{allColumnEncodingTypes}'/>
...
</...@s.iterator>
</...@s.iterator>

On the receiving Action I've got setters for a List<List<Integer>>
columnEncodingTypeIds but it's not getting set properly.  I could also
do it as a Map but it'd be a little more difficult to parse (unless it
was something like a Map<String, List<Integer>>) ... Any input on how
to properly set this up would be much appreciated.

Thanks in advance!
Allen

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org