Wicket: can Checkgroup be Ajax enabled?

浪尽此生 提交于 2019-12-24 11:37:43

问题


I have a dynamic list of choices, each represented by a checkbox. I also have a "select all" check box that selects them all. i am using a CheckGoup, CheckGroupSelector and Check and everything works great. now there is a new requirement to change the state on some other controls on the page when some of the checkboxes are selected.

I thought the simpliest is to Ajax-enable the Check but it seems its not possible. seems that Check does not allow you to add a AjaxFormComponentUpdatingBehavior to it.

is there any simple way to achieve this?

I was also thinking of using plain o'ld checkboxes and add javascript to do the select all. At least the checkbox can be ajax-enabled.

thoughts?


回答1:


The easiest would be to replace the CheckBoxes by AjaxCheckboxes since The CheckGroupSelector triggers the onClick event of each associated Checkbox, thus triggering the Ajax-part oft he AjaxCheckbox. As far as I know (and as far as the Javadoc states), the CheckGroupSelector runs on the client-side in JavaScript so this should work.



来源:https://stackoverflow.com/questions/5988905/wicket-can-checkgroup-be-ajax-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!