struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadia Kunkov" <>
Subject html:options won't get preselected!
Date Thu, 30 Dec 2004 16:04:30 GMT
I have a form that my action prepopulates and that works fine. For example:
        <html:text  property="country"/>
Country is FormBean property that is populated from the database by my action.  This is all
good but I want the user to be able to change the country so I need a dropdown list.
Here is what I have:
        <html:select property="country" >
                <html:options collection="countryList" property="countryID" labelProperty="countryName"/>
 CountryList is a bean in request scope.  The above gives me a drop down list with all the
countries in the database but I need one country to be preselected. I already have the right
value in the form which I can get using <html:text  property="country"/>
.  As far as I understand if the value in the formbean equals the value in the dropdown list
this value will be preselected.  This does not happen for me.    My dropdown list has random
What am I doing wrong?
Thanks for your help.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message