GWT UIBinding 找不到零参数构造函数

发布于 2024-08-28 18:07:39 字数 860 浏览 6 评论 0原文

我正在尝试新的 GWT 2.0 UIBinder 功能,并且我有一个如下所示的 ui XML:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:my='urn:import:com.mystuff.mypackage'>
<g:VerticalPanel>
      <!-- other stuff -->
  <my:FileUploadPanel.ValidatingFileUpload styleName="field" ui:field="fileUpload" />
</g:VerticalPanel>

ValidatingFileUpload 是 FileUploadPanel 中包含的非静态内部类,它扩展了 FileUpload GWT 类。它有一个显式的零参数构造函数,只需调用 super()。但是,当 GWT 启动时,我收到此错误:

00:00:18.359 [ERROR] Rebind result 'com.mystuff.mypackage.FileUploadPanel.ValidatingFileUpload' has no default (zero argument) constructors.
java.lang.NoSuchMethodException: com.mystuff.mypackage.FileUploadPanel$ValidatingFileUpload.<init>()

知道这里可能出了什么问题吗?

I'm trying my hand at the new GWT 2.0 UIBinder capability, and I have a ui XML that looks like this:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:my='urn:import:com.mystuff.mypackage'>
<g:VerticalPanel>
      <!-- other stuff -->
  <my:FileUploadPanel.ValidatingFileUpload styleName="field" ui:field="fileUpload" />
</g:VerticalPanel>

ValidatingFileUpload is a non-static inner class contained in FileUploadPanel that extends the FileUpload GWT class. It has an explicit zero-arg constructor that simply calls super(). However, when GWT starts up, I get this error:

00:00:18.359 [ERROR] Rebind result 'com.mystuff.mypackage.FileUploadPanel.ValidatingFileUpload' has no default (zero argument) constructors.
java.lang.NoSuchMethodException: com.mystuff.mypackage.FileUploadPanel$ValidatingFileUpload.<init>()

Any idea what might be going wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少女净妖师 2024-09-04 18:07:39

非静态内部类需要在其包含类的实例中实例化。这会阻止 UiBinder 在需要时实例化它。尝试使用静态嵌套类。

A non-static inner class needs to be instantiated within an instance of its containing class. This prohibits UiBinder from instantiating it when needed. Try using a static nested class instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文