Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在GWT中向RegistrationHandler注册ArrayList?_Gwt_Mvp - Fatal编程技术网

如何在GWT中向RegistrationHandler注册ArrayList?

如何在GWT中向RegistrationHandler注册ArrayList?,gwt,mvp,Gwt,Mvp,在我当前的项目中,我使用MVP模式,我想为一些复选框注册一个可变的RegistrationHandler计数 大概是这样的: 在my View.java中,我有: 公共ArrayList getCheckBoxesHandlersClickHandler处理程序{ ArrayList handlerRegistration=新建ArrayList; 对于小部件复选框:availableSets{ handlerRegistration.addCheckBoxcheckBox.addClickHa

在我当前的项目中,我使用MVP模式,我想为一些复选框注册一个可变的RegistrationHandler计数

大概是这样的: 在my View.java中,我有:

公共ArrayList getCheckBoxesHandlersClickHandler处理程序{ ArrayList handlerRegistration=新建ArrayList; 对于小部件复选框:availableSets{ handlerRegistration.addCheckBoxcheckBox.addClickHandlerhandler; } 回执登记; } 如何在演示者中处理此问题?下面的代码不起作用,因为我不知道如何从数组中捕获处理程序

display.getCheckBoxesHandler新建ClickHandler{ @凌驾 公共void onClickClickEvent事件{ //在这里做点什么 } }; 格里茨, destiny

我们使用元素id

对于AvailableSet中的每个小部件复选框。设置id.checkBox.getElement.setIdcheckbox+i


然后在演示者中,您可以检查在event.getSource上激发了哪个id。将其转换到Widget并获取id。

ah sry:我的程序代码中有一个错误。如果checkBoxPanel为空,我将设置我的处理程序:-X,但感谢您提供id为的提示: