3

I have a TabLayoutPanel that I access from ie7. The first time I view the tab it is collapsed ~32px x 32px. If I select the second tab, the content area fills, and I can go back to the first tab and it looks correct. I am using and all the ancestors of the tablayoutpanel are some form of layoutpanel. It works in ie8 and chrome. Any ideas?

Update: I have noticed that it is the resizing that is not working for the tab panel. The panel will only resize when I switch between tabs. When I change the browser window size, the tab panel stays the same size. The second I change tabs, the tab panel fills the browser correctly.

Matthew Sowders
  • 1,640
  • 1
  • 19
  • 32
  • Which version of GWT are you using? There's a related bug: http://code.google.com/p/google-web-toolkit/issues/detail?id=4596 , and I'm not sure, if you're seeing secondary effects of that issue. (People are reporting, that this particular problem has been fixed, though the bug status has not been updated.) – Chris Lercher Jun 29 '11 at 21:01
  • no, that was not it. I'm using GWT 2.3 and that issue says it works on ie7 and my problem is the reverse of that issue. It only updates the size after changing tabs. – Matthew Sowders Jun 29 '11 at 21:07
  • I wonder, if the (not-officially-approved) fix to #4596 has actually _introduced_ your problem – Chris Lercher Jun 29 '11 at 21:09

4 Answers4

3

Are you by chance adding the tabs to the TabLayoutPanel before adding it to the page?

I've noticed that if you add the TabLayoutPanel to the page, then add the tabs, this problem will go away.

Pat
  • 51
  • 1
3

I don't see how Issue 4596 is fixed ( not in 2.3.0 anyway), I'm seeing the exact same effect under ie7.

Fortunately here's a workaround you can add in your view or whatever composite you're using. It works for me, however note that I specify the size of the TabLayoutPanel, since it's in the middle of an HTMLPanel.

@Override
protected void onAttach() {
  super.onAttach();
  tabPanel.forceLayout();
}
2

Guillaume's solution almost worked for me, except that I had to run it during the next event loop (don't ask me why):

Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand()
{
  public void execute()
  {
    tabPanel.forceLayout();
  }
});
Hbf
  • 3,074
  • 3
  • 23
  • 32
0

I have a similar problem. I explicitly call

tabPanel.selectTab(0);

and then the first time that I visit my UI with the tabbed panel the components are shown correctly.

Diego
  • 462
  • 10
  • 26