PDA

View Full Version : Resizing a TabPanel inside a modal window



SuperSloMo
20 Dec 2010, 9:22 PM
The application that I am working on had a ContentPanel and a LayoutContainer inside a modal Window. This is similar to the AdvancedListView demo's code, except that it uses a modal Dialog. I was told to put the ContentPanel and LayoutContainer in a tab in the window and create a second tab to display other kinds of information. So now my application has a structure like

Viewport -> Window -> TabPanel -> TabItem1 -> ContentPanel
| |-> LayoutContainer
|
|-> TabItem2 -> TBD
Before I added the TabPanel and the TabItems, when I changed the Window size, the ContentPanel and LayoutContainer would resize appropriately too. Now when I do this, the TabPanel stays the same size.

What is the best way to make the TabPanel change its size when the Window that it is in is resized? Should I define a listener that changes the TabPanel's height and width when the Window's height and/or width change, or is there a more automatic way to define things so that the TabPanel resizes appropriately? Thanks.

sven
21 Dec 2010, 2:17 AM
Your layoutchain is broken. Your Window probably misses a FitLayout, so it resizes your TabPane.

SuperSloMo
21 Dec 2010, 9:15 AM
How right you are. I foolishly assigned a FitLayout to the TabPanel instead of the Window and didn't notice that the Window was the right place to put it. Thanks.