views:

85

answers:

1

I have a trivial TabLayoutPanel made with a UIBinder. The tabs render but none of the contents do. It's in the HTML, but it's always collapsed (inline styles set on the elements make it collapse). As far as I can tell this is identical to every TabLayoutPanel example I've seen. Other widgets render fine. The project is just the basic example with the default HTML and code stripped out.

The XML is:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"&gt;
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
 xmlns:g="urn:import:com.google.gwt.user.client.ui">
 <g:TabLayoutPanel barHeight='22' barUnit='PX'>
  <g:tab>
   <g:header>Tab A</g:header>
   <g:HTML>
   asdf
   <p>asdfasdf</p>
   </g:HTML>
  </g:tab>
  <g:tab>
   <g:header>Tab B</g:header>
   <g:Label>blah</g:Label>
  </g:tab>
  <g:tab>
   <g:header>Tab C</g:header>
   <g:Label>blah</g:Label>
  </g:tab>
 </g:TabLayoutPanel>
</ui:UiBinder>

And the Java is:

public class Main extends Composite {

 private static MainUiBinder uiBinder = GWT.create(MainUiBinder.class);

 interface MainUiBinder extends UiBinder<Widget, Main> {
 }

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

And I'm adding it to my app like this:

public void onModuleLoad() {
  RootPanel.get().add(new Main());
 }

I'm stunned. This should be trivially easy. I must be missing something stupid. Any ideas?

+3  A: 

Add it to RootLayoutPanel.

public void onModuleLoad() {
  RootLayoutPanel.get().add(new Main());
}

And dont forget to use correct DOCTYPE in your html.

<!DOCTYPE html>
pathed
Sigh, yep, that was it. RootLayoutPanel instead of RootPanel. doctype was correct.
Matt Olenik