Reputation: 89
i have to extend a given GWT project (let's call it X) and want to add a window in which i visualize my stuff. Since i'm new to GWT i created a test project and tried to create a TabLayoutPanel. In this test project the TabLayoutPanel is displayed as it should, but in X it is not:
http://abload.de/img/tablayoutpanelc1svz.png
The code for the TabLayoutPanel is from the GWT tutorial
uiBinder
<!-- HelloWidgetWorld.ui.xml -->
<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 size='7'><b>HTML</b> header</g:header>
<g:Label>able</g:Label>
</g:tab>
<g:tab>
<g:customHeader size='7'>
<g:Label>Custom header</g:Label>
</g:customHeader>
<g:Label>baker</g:Label>
</g:tab>
</g:TabLayoutPanel>
</ui:UiBinder>
Java
public class HelloWidgetWorld extends Composite
{
interface IuiBinder extends UiBinder<Widget, HelloWidgetWorld> {}
private static IuiBinder uiBinder = GWT.create(IuiBinder.class);
@UiField TabLayoutPanel tabLayoutPanel;
public HelloWidgetWorld()
{
initWidget(uiBinder.createAndBindUi(this));
}
}
The code to use this in my test project is
public class Test implements EntryPoint
{
private Window HelloWidgetWorldWindow;
public void onModuleLoad()
{
RootLayoutPanel.get().add(new HelloWidgetWorld());
}
}
By trying to narrow down the problem i finally ended up by using the exact same code in X but still having the problem. So i copied this code into X, so the onModuleLoad() code is the same. I also copied the css and html file from the test project to X, but the panel still looks not as it should.
Since the code is now all the same, it just can be something in other project files or settings?
Spending now 5 hours to get that one fixed without success, i really hope you can help me!
/edit
I'm now trying to rebuild the given project X, starting from a fresh project and then importing code, libs, js, css, *.xml and so on. After each step i check if my minimal example works. Perhaps this way i can track down which component breaks the TabLayoutPanel visualization. I'll update the result here.
Upvotes: 0
Views: 800
Reputation: 175
Add TabLayoutPanel in any widgets (Vertical/Horizontal/...) panels
tabs not appears because the TabLayoutPanel does not have any height or width(mainly percentages won't work, you'll have to use a different unit).
check you're using one of the new Layout panel from GWT 2.5
Upvotes: 1