Adding another item to collection object
State:
<html:select property="product.stateId" size="1" onchange="loadProducts();loa开发者_如何转开发dProducts2();">
<html:options collection="stateList" property="id" labelProperty="name"/>
</html:select>
I want to add another option to the list of states such as, "Please select state," in the drop down menu. I think I need to modify the Java collection object..
Just add a <html:option>
tag which represents that. The TLDDOC allows that:
This tag can be used multiple times within a single
<html:select>
element, either in conjunction with or instead of one or more<html:option>
or<html:optionsCollection>
elements.
精彩评论