Code is executing correctly,but I dont get how selected option is getting selected based on the code above. I have a question about SELECTED value in HTML Select. How does SELECTED gets selected ( selected="selected" as appears on html)
Thank you in advance. [ December 13, 2006: Message edited by: Bear Bibeault ]
It is based on the property attribute of your html:select tag. If you do not specify the name attribute, then that tag defaults to using the form of the enclosing html:form tag for the name. Based on your example, Struts will call the getFa() method on your form. It will iterate over your collection and mark as selected the item that has a matching property value.
Is this working for you?
Joined: Jul 20, 2006
Thank you. it makes sense because I didnt have method getFa(). When select tag was getting loaded on html page it was showing selected="selected" for option values with "".