Au-Yeung, Stella H wrote:
Paul wrote:
<html:select name="UserFormBean" property="userId"> <html:options collection="uList" property="id"
labelProperty="name"/> </html:select>
No I don't know how to try yours because I don't see how the above statement tells it to compare "userId" with "person.id" and then store the value into "person.id".
In other words, I don't know how to convert my statement below to yours:
<bean:define id="uList" name="UserFormBean" property="userList"/> <html:select property="person.id" value="person.id"> <html:options collection="uList" name="UserFormBean" property="userId" labelproperty="commonName"/></html:select>
-----Original Message-----
From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: Re: <html:select> question
i think you are trying to do the following...
<html:select name="UserFormBean" property="userId"> <html:options collection="uList" property="id" labelProperty="name"/> </html:select>
this is assuming uList is a list of beans with id/name fields and your form has a userId field.
Au-Yeung, Stella H wrote:
Hi:
I need to set a "pre-defined" option in <html:select> using the "value=" attribute, I thought the following will work:
<bean:define id="uList" name="UserFormBean" property="userList"/> <html:select property="person.id" value="person.id"> <html:options collection="uList" name="UserFormBean" property="userId" labelproperty="commonName"/></html:select>
I have a "person" bean. I want to set the "selected" option if "person.id" matches "userId" . I thought the "value" attribute is to
be
compared with for marking an option selected. But the above doesn't
work.
It always set the 1st option to be the "selected" option . Am I misunderstanding the use of "value="?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]