tks for both of u try to help me
<s:iterator value="beds" status="st" >
<s:property value="bed_id"/>
</s:iterator>
the above works, and print the value of bed_id
but, the following still not works
<s:iterator value="beds" status="st" var="curBed">
<s:checkbox name="%{'bed[' + (st.count-1) + ']'}"
alue="#curBed.bed_id"></s:checkbox>
</s:iterator>
and running result complain the "var" tag
please advise, tks in advance
john
--- On Fri, 4/10/09, Dave Newton <[email protected]> wrote:
From: Dave Newton <[email protected]>
Subject: Re: <s:checkboxlist or <s:checkbox
To: "Struts Users Mailing List" <[email protected]>
Date: Friday, April 10, 2009, 6:28 PM
Wes Wannemacher wrote:
> Second, when you are using the iterator and creating single checkboxes, you
> need to make the names unique. You are simply creating a new checkbox with
> the name "beds" over and over again.
Putting in an index only matters if order is important (and you don't trust the
browser to submit in order); if a page has multiple variables of the same name
their values will be put into an array or collection action property.
For a checkbox w/ a true/false value probably need either an index or to use a
map-based property.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]