Wicket: can Checkgroup be enabled Ajax?

I have a dynamic list of options, each of which is represented by a checkbox. I also have a Select All checkbox that selects them all. I use CheckGoup, CheckGroupSelector and Check and everything works fine. there is now a new requirement to change state on some other controls on the page when some checkboxes are selected.

I thought the easiest way to Ajax is to enable Check, but it seems impossible. it seems that Check does not allow you to add AjaxFormComponentUpdatingBehavior.

is there any easy way to achieve this?

I also thought about using simple checkboxes and added javascript to do everything. At the very least, the checkbox can be enabled by ajax.

thoughts?

+1
source share
1 answer

The easiest would be to replace CheckBoxes with AjaxCheckboxes , because CheckGroupSelector fires the onClick event of each associated flag, thereby calling the Ajax part of it AjaxCheckbox. As far as I know (and as for Javadoc states), CheckGroupSelector works on the client side in JavaScript, so this should work.

+2
source

Source: https://habr.com/ru/post/1382694/


All Articles