开发者

struts2 select tag, second select based on value of first select

开发者 https://www.devze.com 2023-01-05 19:38 出处:网络
I have 2 select, I want the second select list loads based on selected value of first select. In another word first select is a list of objects, those objects each has a list of another objects. so I

I have 2 select, I want the second select list loads based on selected value of first select. In another word first select is a list of objects, those objects each has a list of another objects. so I want load second list based on selected object of first select开发者_运维百科. I know that can be done using JQuery, but can I do this without JavaScript/JQuery?

Thanks in advance.


There is a tag that does this for you http://struts.apache.org/2.x/docs/doubleselect.html

Out of the box it probably uses Dojo API or uses a server side request to generate the second list. I have not used any of the JQuery UI in Struts.


No, you can't do this without Javascript. With static HTML you can't achieve this effect; drop-down fields on HTML forms come pre-loaded with their options, and are independent of other fields on the form.

0

精彩评论

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