Hi everybody,

I have a form for updating the user information in my application. This form
is loaded when I click on an "update" link in my user information table.

The update form includes: username, password, and email fields, followed by
a drop-down list of available user groups that the user can be part of (this
list is dynamically generated from a table in DB). I easily pre-populate the
text fields like this:

<html:text property="name" name="editinguser"/>

where "editinguser" is the name of the bean containing the user object
information, stored in the session.

My problem is that I don't know how to pre-select the related user group in
the combo-box. At present my code is:

<html:select property="groupid">
  <html:options collection="allUserGroups" property="groupid"
labelProperty="groupname" />
  </html:select>

where allUserGroups is the collection containing the group objects. Now how
can I make the groupid of "editinguser" be selected in allUserGroups
combo-box?

TIA.

-- 
View this message in context: 
http://www.nabble.com/How-to-pre-select-a-select-list--tp17149112p17149112.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to