struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadia Kunkov" <nad...@parkerglobal.com>
Subject html:options won't get preselected!
Date Thu, 30 Dec 2004 16:04:30 GMT
Hi,
I have a form that my action prepopulates and that works fine. For example:
<td>
        <html:text  property="country"/>
</td>
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"/>
        </html:select>
 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
order.
What am I doing wrong?
Thanks for your help.
      
                                                                                         
                                   


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


Mime
View raw message