Search code examples
javagwtuibinder

GWT ui binder: nesting custom widgets


I have two custom widgets Foo extends Composite and Bar. I would like to nest them in my ui.xml as follows:

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

I would expect that some method will be called on Foo, addWidget or kind of. However I get the following error:

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

How could I get this fixed? Is it possible to nest my custom widgets in ui.xml?


Solution

  • Ok, I got it: Foo had to implement HasWidgets as well!