Trying to extend AbsolutePanel, my UiBinder won't allow the <g:at>
element which is normally ok for straight AbsolutePanels. How do I make my AbsolutePanel subclass able to use the <g:at>
element? And more generally, can I make custom UiBinder keywords for my own custom Widgets like "at", "west", "layer" etc.?
You can use @UiChild to declare special functions in your widgets accessible in UiBinders.
for example,
class MyPanel extends AbsolutePanel {
@UiChild
public void addAt(Widget w, String parameter1, String parameter2) {
....
Then, in your uiBinder, you can say
<custom:MyPanel>
<custom:at parameter1="HI" parameter2="Anything you like!">
<g:AnySingleWidget />
</custom:at>
</custom:MyPanel>
See @UiChild at http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html
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