<c:forEach items="${reports}" var="row">
<tr>
<td align="left" valign="top">
<html:multibox property="reportList">
<c:out value="${row.key}"/>
</html:multibox>
</td>
this produces something like:
<td align="left" valign="top">
<input type="checkbox" name="reportList" value="key1">
....
<td align="left" valign="top">
<input type="checkbox" name="reportList" value="key2">
it's still an indexed array - I don't really know what the difference is if you say
reportList[0] =
reportList[1] =
or just say
reportList =
reportList =
but anyways, that's what worked for me.
-Ben
From: "Gregory F. March" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: Struts Users Mailing List <[EMAIL PROTECTED]> Subject: html:checkbox, iterate and a value Date: Fri, 15 Aug 2003 12:48:40 -0400
What is the "proper" way to build html:checkbox's inside of an logic:iterate loop?
It seems that the html:checkbox's value parameter can't reference a property from the bean of the iterate loop.
I have something close to:
<logic:iterate id="myItem" name="myData" type="...MyData" indexId="index"> ... <html:checkbox indexed="true" property="uniqueKey" name="myItem"/> ... <html:link action="MyViewItemsAction" paramId="myId" paramName="myItem" paramProperty="uniqueKey"> <bean:write name="myItem" property="uniqueKey"/> </html:link> ...
The html:link works great. I just don't know how to achieve the same for the checkbox. What I get sent is:
myItem[0].uniqueKey=on myItem[1].uniqueKey=on myItem[2].uniqueKey=on
Not much of a help. I really need the value of that uniqueKey to be the value of the checkbox.
Any help steering me in the right direction would be appreciated.
Thanks!
/greg
--
Gregory F. March -=- http://www.gfm.net:81/~march -=- AIM:GfmNet
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]