开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜