【问题标题】:GWT ui binder: nesting custom widgetsGWT ui binder:嵌套自定义小部件
【发布时间】:2012-12-10 12:56:00
【问题描述】:

我有两个自定义小部件 Foo extends Composite 和 Bar。我想将它们嵌套在我的 ui.xml 中,如下所示:

<my:Foo width="100%" ui:field="myFoo">
  <my:Bar label="someLabel"/>
</my:Foo>

我希望某些方法会在Foo、addWidget 或其他类型上调用。但是我收到以下错误:

Found unexpected child element Element <my:Bar label='someLabel'>

我怎样才能解决这个问题?是否可以将我的自定义小部件嵌套在 ui.xml 中?

【问题讨论】:

  • 您的Foo 和Bar 看起来如何?请给代码。
  • 与 java 示例 (FooBar) 的一致性很好。记得在 Bar 中声明一个 @UiConstructor。

标签: java gwt uibinder


【解决方案1】:

好的,我明白了:Foo 也必须实现 HasWidgets!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 2015-06-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多