You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefan Wesner <we...@rus.uni-stuttgart.de> on 2000/11/17 16:47:48 UTC

How to combine option tag, iterate tag

Hi all,

I have a collection of "Institute" objects the have (beside others) the
properties "id" and "name" supposed to be used as value content within an
select element.

The question is how to expose the id property to the value attribute of the
option tag in  order to receive sth. like

<option value="17">An institute</option>


I try it this way but have no clue what to do with the value attribute:

<form:select size="5" property="instituteId">
   <logic:iterate id="element" name="instituteList">
        <form:option value="??" ><bean:write name="element" property="name"
/>
        </form:option>
   </logic:iterate>
</form:select>

I do not like the options tag as it require to my understanding separate
collections for the ids and the values.

Kind regards,
Stefan Wesner.