Check to make sure the list of options actually contains an entry for which the value attribute is the same as the value of previousAddress.state. Do the values of your options contain state names or state abbreviations? Does previousAddress.state contain a name or abbreviation?
Thanks for your reply , its captured correctly and is there in the list of options as well , i am using LabelValueBean for the options , i had spent quiet some time on this , but nothing really came to know.
I put print statements in getters and setters of state attribute , on the console i can see that my option is getting captured, yet its not appaaring as selected .
Any help will be most appreciated.
Joined: Feb 15, 2005
I don't have any other ideas based on what you've said. If you'd like us to look at it further, post the relevant portions of:
1-ActionForm 2-JSP 3-Action Class 4-struts-config.xml
LabelValueBean you say. I guess I did not know that class existed back when I created a similar class for my project.
When you view the source of your page, what value do you see for the options? Like this example, what is there instead of XXX?
It is this value that you need to store in your action form. Here is a quick example I pulled from a JSP page. My form has property supervisorId that matches up with one of the "id" values, but it is the person's name that the user sees in the list.