instead of using <html:option> you should consider using
<html:options> It will iterate over all the values and build the drop
down for you
<html:select property="depid">
<html:options collection="departments" property="department_id"
labelProperty="depname" />
</html:select>
On 24 Oct 2004 17:09:22 -0000, Vishal Sudheer
<vishalsudheer@rediffmail.com> wrote:
>
> Hi,
>
> <html:select property="depid" size="1">
> <logic:iterate id="department" name="departments">
> <html:option value="">
> <bean:write name="department" property="depname" />
> </html:option>
> </logic:iterate>
> </html:select>
>
> Here I am iterating through an ArrayList (departments)
> which contains department_id and department_name.
>
> Here I want to populate the html:select option with the
> department details. I am able to display the department_nm
> in my browser, but I don't know how to store department_id
> in the value="" section of the code.
>
> Please help.
>
> Thank you.
>
> Vishal
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
|