Struts Combo Box
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Friday, August 8, 2003 07:58 AM

Hi, I am using Struts for the first time. I got to populate a combo box and it works fine, I did it using the next lines


But I can not get the selected value from the ActionForm. I treat "state" as a String. I think the variable "state" in the ActionForm should be populated with the selected value but it is null.

I appreciate any help


Re: Struts Combo Box

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, August 8, 2003 08:18 AM

The framework should (?) be calling your ActionForm's "setState(String)" method, with the selected option's rendered "value" attribute; it doesn't directly change the "state" member field, it only calls the property "setter". Put some debug log code in there, and make sure it gets called? also make sure, do "View Source" on the page as rendered in the browser, what is the actual "value" attribute rendered as, of the HTML "option" tag?

About | Sitemap | Contact