Question

Simple example of TabLayoutPanel not showing container widgets only Tab items are visible. Something going wrong is it works for IE8

public class DemoGWT implements EntryPoint {
    RootPanel rp = RootPanel.get();

    public void onModuleLoad() {
        TabLayoutPanel panel = new TabLayoutPanel(25, Unit.PX);
        Label a = new Label("One Container");
        panel.add(a, "One Hdr");
        panel.add(new Label("Two Container"), "Two Hdr");
        panel.add(new Label("Three Container"), "Three Hdr");
        panel.add(new Label("Four Container"), "Four Hdr");
        panel.add(new Label("Five Container"), "Five Hdr");
        panel.add(new Label("Six Container"), "Six Hdr");

        rp.add(panel);
    }
}
Was it helpful?

Solution

Don't mix up Layout panels and panels. When you use layout panels such as TabLayoutPanel, Make sure its parent and their parent upto RootPanel are layout panels. Use RootLayoutPanel instead of RootPanel. TabLayoutPanel will not display data unless you mention its absolute height. (Note 100% or any other % won't work). It has to be absolute.

Change the RootPanel to RootLayoutPanel and use setHeight(height) API of your TabLayoutPanel. Don't mention height in %age.

OTHER TIPS

I had problems with ie8 with tab client areas not being displayed.

We had created ui XML template panel. Our setup was to display a TabLayoutPanel within a tab of another TabLayoutPanel. The first TabLayoutPanel was entirely visible, the child TabLayoutPanel was invisible but not 'hidden'.

BTW this problem didn't exhibit itself under Firefox!!!!!

Making all panels children of ResizeComposite and ultimately children of root layout panel made no difference. However I kept that mod as it seemed to be the correct GWT way of coding layout panels.

The problems solution as it turned out was quite surprising and unexpected.

I had specified sizes of composite panels in EM units. When I switched the child TabLayoutPanel to PX units and it's tab children panels to PX units everything displayed OK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top