struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsarris <chi...@gmail.com>
Subject Struts <html:select> usage question
Date Thu, 30 Dec 2004 08:48:32 GMT
Hi,

I am trying to use the <html:select> tag with the
<html:optionscollection> tag. The documentation states that the
optionscollection tag retrieves ithe collection from the bean that is
specified using the name property.
My question is the following:

Do I have to put the collection property inside the form bean of the
form that contains the <html:select>?

For example:

myAction.do has the form bean myActionFormBean.

Code:
<html:form action="/myAction.do">
<table>
<tr>
   <td>Name</td>
   <td><html:text  property="name" /></td>
</tr>
<tr>
    <td>Surname</td>
    <td><html:text  property="surname" /></td>
</tr>
<tr>
    <td>Marital Status</td>
    <td>
         <html:select property="maritalStatusId">
      <html:optionsCollection
         name="myCustomBeanNotTheSameAsTheForm"
             property="maritalStatus"
             label="name"
             value="id"/>
          </html:select>
    </td>
</tr>
</html:form>


Is it going to work if the "myCustomBeanNotTheSameAsTheForm" is saved
in the session?

Thenak you

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message