Hi All,

I would like to generate a select box that will contain all my available
categories.
I need each option in select box to store a category object.
When user selects an option, the selected category (object) needs to be
passed onto my Items category setter.
(ItemsForm.setCategory(<option-selected-cat-object>))

mypackage.Category class fields:
----------------------------------
id : Long
name : String
description : String
products : List


struts-config.xml
----------------------------------
<form-bean name="ItemsForm"
      type="org.apache.struts.validator.DynaValidatorForm">
      ...
      <form-property name="category" type="mypackage.Category"/>
      ...
</form-bean>

jsp file with ItemsForm form
---------------------------------
<html:form action="...">
  ...
  <td align="left">
    <html:select property="category">
        <html:option value=""><bean:message
key="options.select.firstselect"/></html:option>
        <html:options ??????????/>
    </html:select>
  </td>
  ...
</html:form>

Before getting to the above jsp view, I run via an action class that sets an
attribute for populating categories named 'categoryList' of type
java.util.List.


Any clues much appreciated,

--Alen




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to