I've faced with a task to create custom widget, it has container behavior -- 3 panels inside. And i would like to use it in general UIBinder way like CustomButton
<u:MyWidget>
<u:image><g:Image .../></u:image>
<u:mainContent><g:Panel.../></u:mainContent>
</u:MyWinget>
Is it possible to define that custom child elements somehow or maybe it is predefined thing in the UIBuilder?
Thanks in advance
Correct way to do it is to use the UiChild annotation.
public class MyWidget extends Composite {
public MyWidget() {
// ...
}
@UiChild( tagname = "image" )
void addImage(Image image) {
// ...
}
@UiChild( tagname = "mainContent" )
void addMainContent(Widget contentWidget) {
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With