struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zoran Avtarovski <zo...@sparecreative.com>
Subject Multi dimension array from form
Date Thu, 01 Nov 2012 14:47:26 GMT
I have a two dimension array in my action:

Integer[][] dataArray with appropriate getter/setter.

In my form I use the following checkbox tag to pass the data from user to
action

                        <s:iterator var="attributeType" value="someList"
status="typeStat">
                            <s:iterator value="aDpendentList"
var="attribute" status="attStat">
                                <s:checkbox
name="dataArray[%{#typeStat.index}][%{#attStat.index}]"
label="%{#attribute.name}" fieldValue="%{#attribute.attributeId}"/>
                            </s:iterator>
                        </s:iterator>

The form renders correctly in that the checkboxes are named dataArray[0][1]
and so forth, but I can't the array form data into the array.

Is there something I'm missing? I thought this was possible.

I'd appreciate any help as the only other option I can see is to construct a
string with a the multi dimension data and then token and construct the
array in the action, which I'd rather not.

Z.




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message