0
votes

I have a GWT app which uses the TabLayoutPanel using UiBinder. I have got UiBinder as:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
             xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <g:TabLayoutPanel ui:field="tabLayoutPanel" barUnit="em" barHeight="3">
        <g:tab>
            <g:header>Welcome</g:header>
        </g:tab>
        <g:tab>
            <g:header>Login</g:header>
        </g:tab>
    </g:TabLayoutPanel>
</ui:UiBinder>

And the view code as:

public class MyView extends Composite {
    interface MyUiBinder extends UiBinder<Widget, MyView> {}
    private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

    @UiField TabLayoutPanel tabLayoutPanel;

    public AuthenticateView() {
        initWidget(uiBinder.createAndBindUi(this));
    }
}

This code always crash with an error:

    Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.mycompany.MyView' (did you forget to inherit a required module?) at 
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at
 com.google.gwt.core.shared.GWT.create(GWT.java:57) at 
com.google.gwt.core.client.GWT.create(GWT.java:85)

Could someone tell me what went wrong.

I did add this to a RootLayoutPanel through.

Many thanks

2
Deferred binding failed for 'com.mycompany.MyView' (did you forget to inherit a required module?) usually means you forgot to inherit something in your gwt.xml - Romain Hippeau
Can you share the rest of the stack trace?, and any other errors/warnings? It appears you are getting this in dev mode - can you share the error (if any) when you compile? - Colin Alworth

2 Answers

0
votes

As per TablayoutPanel docs

This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit declaration

It seems problem with the DOCTYPE of your host html page .

can please verify that your host HTML page has the doctype for standards mode only? Try with changing <!DOCTYPE html>.

And suggesting an example to crosscheck and TabPanel also.

0
votes

You could get this error if the package containing the MyView class is not defined as a source package (using the source tag) in your *.gwt.xml.