开发者

Adding another item to collection object

开发者 https://www.devze.com 2023-01-06 10:17 出处:网络
State: <html:select property=\"product.stateId\" size=\"1\" onchange=\"loadProducts();loa开发者_如何转开发dProducts2();\">
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.

0

精彩评论

暂无评论...
验证码 换一张
取 消