Search This Blog

Showing posts with label GXT. Show all posts
Showing posts with label GXT. Show all posts

09 February 2010

GXT: BorderLayout inside TabPanel

I had originally posted a bug in the GXT premium forum about BorderLayout not working inside a TabPanel.  To prove the point, I took the demo code directly from the site and put it verbatim inside a tab.

Since the post never showed up in the forum, I can't answer it myself so others know how to fix the problem... so it'll go here.

The BorderLayout code does the following:
Size size = target.getStyleSize();
int h = size.height;
b.y = h - totalHeight + m.top;

Normally this would be fine.  However, when embedded within the TabPanel, I had used the following line from the Tab demo:

setAutoHeight(true);
This is actually what was causing the problem.  With this set to true, the surrounding div didn't have an explicit height set and so was setting the y coordinate of the South region to 0-188+10.  Removing that one line caused everything to layout as expected.