struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Schenk" <M.M.A.Sch...@dto.tudelft.nl>
Subject RE: Multiple checkboxes, same name...
Date Wed, 25 Jul 2001 13:11:03 GMT
> Hi all.  Very new to this list and struts, but using it pretty
> successfully
> for
> a project at work.  Good looking framework.  Now the question:
>
[snip]
>
> The above sounds pretty reasonable, but I'm unsure how
> to get it to work.  Specifically, how to get the proper value=
> attribute in the multibox tag:
>
> <!-- vehicles is a page-scope hashtable -->
> <logic:iterate id="entry" name="vehicles">
>   ** how to get the key property of 'entry' into value attrib? **
>   <html:multibox property="principalOperators" value="???">
>     <bean:write name="entry" property="value"/>
>   </html:multibox>
> </logic:iterate>
>

Hello Carmine,

	you've almost answered your own question: if you want the value to be
calculated during the iteration, leave the value parameter off! In this case
struts will use the body of the html:multibox tag as the value. So:

 <logic:iterate id="entry" name="vehicles">
   <html:multibox property="principalOperators">
     <bean:write name="entry" property="value"/>
   </html:multibox>
 </logic:iterate>

does what you want.

Cheers,
	Mark

----------------------------------------------------------------------------
Mark Schenk                     |	Ceci n'est pas une signature
Blackboard Project Manager      |
Delft University of Technology  |E-mail: M.M.A.Schenk@dto.tudelft.nl
Dept.: DTO                      |Phone:  +31 152785448 (85448)
Room: LB00.680                  |Fax:	 +31 152786359
----------------------------------------------------------------------------
-


Mime
View raw message