开发者

<s:select> use map as list excluding given keys

How can I use a map as the list of a 开发者_运维问答struts2 select tag such that I can exclude some values from showing up in the drop down list, based either on the keys I give or the values I tell it to exclude?


Your choices are slim. It sounds like you just need to manipulate the DOM on the client side. The best way to accomplish this would be to use something like jQuery to manipulate your options. If you need to do this dynamically with no page refresh, I can't think of any other options offhand.

If you need to base your related selects dynamically and with some struts action-interaction, a jQuery/Ajax solution could be used.


Just remove those values from the map before you pass the map to your view.


Your requirement is nothing but DOM manipulation ,better you use java script frameworks to do this . onchange of select box is the event to be handled.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜