Thursday, January 3, 2013

How to extend GWT Widgets and use them with Ui-Binder?

I'm creating a custom Tree component which extends the GWT Tree.
But how can I use my custom tree with ui:binder??

I tried the following which did not work:

my custom tree:
public class CustomTree extends Tree {
    public CustomTree() {
        //...
    }
}


MyPanel.ui.xml:
<ui:UiBinder>   
    <CustomTree ui:field="tree" />
</ui:UiBinder>


MyPanel.java:
public class MyPanel extends Composite {
    @UiField
    CustomTree tree;

    public MyPanel() {
        initWidget(binder.createAndBindUi(this));
        //...
    }
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/KLwtm8XUaV8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment