Hi,
I have the following listview:
Person 1
[ ] No insurance
[ ] insurance 1
[ ] insurance 2
[ ] insurance 3
Person 2
[ ] No insurance
[ ] insurance 4
[ ] insurance 5
[ ] insurance 6
Person 3
[ ] No insurance
[ ] insurance 7
[ ] insurance 8
[ ] insurance 9
Every person can book individual insurances (because they depend on the
price per person).
I'd like to do this: When a person selects "No insurance", all the other
insurances for that person should be unchecked, using JavaScript. When a
person selects one of the insurances, though, the "No insurance"
checkbox should be unchecked.
I know Wicket has JavaScript support to some degree. What would be the
best solution? I don't think Ajax would make sense. But on the other
hand, it's not so easy to identify the checkboxes that should be
unchecked, because the names are being generated at runtime. Maybe there
is an elegant way to dynamically generate ids for the checkboxes. They
could consist of the number of the person and the number to the checkbox
field. And I'd call the JS function with the id of the checked checkbox
as a parameter, ie:
onSelect="uncheckBoxes(this.id)"
where id might be "0-0" for the first person and the first checkbox (the
"No insurance" one) or "2-1" for the 3rd person and the 2nd checkbox....
I don't know, what would be the most elegant way to go?
- Johannes.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user