> 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: [EMAIL PROTECTED]
Dept.: DTO                      |Phone:  +31 152785448 (85448)
Room: LB00.680                  |Fax:    +31 152786359
----------------------------------------------------------------------------
-

Reply via email to