UiBinder Issue

492 views
Skip to first unread message

drobe

unread,
Nov 6, 2009, 12:31:47 AM11/6/09
to Google Web Toolkit
Hey, so I've been attempting to work with UiBinder with GWT 2.0 and
can't seem to see why my module will not compile. Does anyone see
anything I'm doing wrong? Thanks

Query.gwt.xml
<module rename-to='query'>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.uibinder.UiBinder'/>
<entry-point class='com.xx.client.Query'/>
</module>

Query.java
public class Query implements EntryPoint {
interface Binder extends UiBinder<DockLayoutPanel, Query> { }
private static final Binder binder = GWT.create(Binder.class);

public void onModuleLoad() {
DockLayoutPanel outer = binder.createAndBindUi(this);

RootLayoutPanel root = RootLayoutPanel.get();
root.add(outer);
root.layout();
}
}

And the error:
java.lang.RuntimeException: Deferred binding failed for
'com.xx.client.Query$Binder' (did you forget to inherit a required
module?)

matthieu vidal

unread,
Nov 6, 2009, 3:09:04 AM11/6/09
to Google Web Toolkit
Hi

You should have a problem with the file Query.ui.xml file name( not in
the right place or bad name probably)

regards

eggsy84

unread,
Nov 6, 2009, 4:44:35 AM11/6/09
to Google Web Toolkit
I've done a little blog post on this that might help:

http://eggsylife.co.uk/2009/11/01/gwt-2-0-declarative-interfaces/

drobe

unread,
Nov 6, 2009, 1:25:48 PM11/6/09
to Google Web Toolkit
Thanks for the replies. eggsy, I've reviewed your blog post and tried
to add the @UiTemplate annotation and still the same issue. I may be
wrong, but it seems like it doesn't see my module inherits UiBinder,
even though it is declared in the module gwt.xml file.

drobe

unread,
Nov 6, 2009, 7:56:35 PM11/6/09
to Google Web Toolkit
Alright, I got it. I was trying to use an HTML element (<h1>) instead
of a Widget for the DockLayoutPanel.

Failed:
<g:DockLayoutPanel unit='EM'>
<g:center>
<h1>Test</h1>
</g:center>
</g:DockLayoutPanel>

Correct:
<g:DockLayoutPanel unit='EM'>
<g:center>
<g:Label>Test</g:Label>
</g:center>
</g:DockLayoutPanel>


Thanks again for the helpful replies.

matthieu vidal

unread,
Nov 7, 2009, 5:28:01 AM11/7/09
to Google Web Toolkit
Thank's for this return

Regarding the error message produced by this problem, that's mean that
XML Validation is mandatory.

I have more and more doubt about the benefit of UIBinder :

- ui.xml files are made of a new language (XML schema validation is
obviously mandatory) and we still have to to handle the java widget
object in their own java classes.

Sorry if I've missed something obvious.
Reply all
Reply to author
Forward
0 new messages