如何将 @UIBinder 与 CheckBox ValueChangeEvent 一起使用?
我正在尝试让它工作:
@UiField
CheckBox showDeleted;
@UiHandler("showDeleted")
public void onShowDeletedClicked(ValueChangeEvent<Boolean> ev) {
...
}
我从 GWT 编译器收到这些错误:
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[WARN] The method 'getAssociatedType()' in 'ValueChangeEvent' does not return Type<? extends EventHandler>.
[ERROR] Parameter 'ValueChangeEvent' is not an event (subclass of GwtEvent).
有谁知道是否可以让它工作?现在我将手动添加一个处理程序,但 @UIBinder 版本要好得多。
I am trying to get this to work:
@UiField
CheckBox showDeleted;
@UiHandler("showDeleted")
public void onShowDeletedClicked(ValueChangeEvent<Boolean> ev) {
...
}
I get these errors from the GWT Compiler:
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
[WARN] The method 'getAssociatedType()' in 'ValueChangeEvent' does not return Type<? extends EventHandler>.
[ERROR] Parameter 'ValueChangeEvent' is not an event (subclass of GwtEvent).
Does anyone know if it is possible to get this to work? For now I will just add a handler manually but the @UIBinder version is much nicer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
GWT 错误 6323 评论 3 提供了让 ui 处理程序注释发挥作用的简单解决方法。感谢罗伊!
GWT bug 6323 Comment 3 provides a simple workaround for getting the ui handler annotation to function. Thanks to Roy!
请参阅 GWT 问题 6323
See GWT issue 6323
也许你的导入是错误的?这确定是
com.google.gwt.event.logic.shared.ValueChangeEvent
吗?Maybe your import is wrong? Is this for sure
com.google.gwt.event.logical.shared.ValueChangeEvent
?