struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allen Lee <Allen....@asu.edu>
Subject dynamic collections as form inputs / tabular inputs
Date Thu, 01 Oct 2009 21:17:05 GMT
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


Mime
View raw message