<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]

