struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <maill...@reumann.net>
Subject Re: html:options question
Date Mon, 06 Jan 2003 19:50:32 GMT


On Monday, January 6, 2003, 2:14:38 PM, Gus wrote:

GD> <html:select name="editUserForm" property="accessType">
GD>        <html:options collection="accessTypeList" property="value" 
GD> labelProperty="label"/>
GD> </html:select>

GD> Example. the options are "Read-only", "Admin", and "Analyst" that's the 
GD> order of the collection, when I edit a user that is Admin, I want the 
GD> drop-down to show with the "Admin" being selected,

GD> How can I accomplish this. Thanks in advanced.

Just make sure "accessType" is set to whatever the value is for
"Admin" in the options. In other words the value fields in
accessTypeList should have "Admin", "Analyst", "Read-only" and
then accessType should also be one of those names as well. (Personally
I usually like to use ints for those values. So that accessType would
be an int value and in the accesTypeList you'd have corresponding
ints for the values and the label would be your String for the title
(Admin, Analyst, etc)). If that doesn't make sense let me know. I
typed this up very quickly:)

-- 

Rick
mailto:maillist@reumann.net


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


Mime
View raw message