| Author |
[Struts 2] How to populate select control after selection of a value in another select control
|
Nicolas Benhamou
Greenhorn
Joined: Sep 18, 2009
Posts: 2
|
|
Hi,
I'm a newbie in Struts 2 and I don't find a good way to link <s:select> on my JSP page.
I have 3 <s:select> populated via 3 linked hierarchic tables : GROUP (id_group, group) > CATEGORY (id_category, id_group, category) > SKILL (id_skill, id_category, skill)
Here is my JSP page, a classic search & list form :
My java class contains methods :
listSkill(), listCategory(), listGroup() and associated Getter and Setter.
When I select a Group, I would like the <select> that display categories only contains categories of the selected Group.
Same thing for Category and Skills.
Thanks a lot !
|
 |
Ranveer K Kumar
Ranch Hand
Joined: Sep 13, 2009
Posts: 64
|
|
You need to use javascript.
|
 |
Nicolas Benhamou
Greenhorn
Joined: Sep 18, 2009
Posts: 2
|
|
According to me, a full javascript solution is not a good one. I would like to minimize client role.
Of course, I tried to do that kind of thing :
On my <select> onchange event :
In my listCategory java method, I retrieve the selected idGroup via the associated getter and then, I load the List<Category>.
Finally I set the list with new values.
In Ecclipse debug mode, the list is the right one but on my jsp page, the <select> is not refreshed.
Maybe a cache problem ?
Thanks !
|
 |
 |
|
|
subject: [Struts 2] How to populate select control after selection of a value in another select control
|
|
|