PDA

View Full Version : BorderLayout Collapsible doesn't work?



phoboshero
31 Aug 2010, 8:38 PM
I got a base class (MasterDetailDisplay.java) extends GPanel with following code:

masterLayoutData = new BorderLayoutData(Style.LayoutRegion.WEST);
masterLayoutData.setMargins(new Margins(0, 5, 0, 0));
master = new LayoutContainer(new FitLayout());
setLayout(new BorderLayout());
add(master, masterLayoutData);
...(add stuff in centre area)

somewhere in my display class:
masterDetailDisplay = new MasterDetailDisplay();
masterDetailDisplay.setCollapsible(true); ----- which will then call masterLayoutData.setCollapsible(true);

then I add a Grid into my master layout container. when its showing up on the screen, it doesn't appear a button or something I can collapse my master layout container.

what problem I got in my code?

Thanks,
Yu

Km.kanagaraj
31 Aug 2010, 8:46 PM
you missed masterLayoutData.setCollapsible(true);

Hope this will work

phoboshero
31 Aug 2010, 10:20 PM
That's because MasterDetailDisplay is a base class I would like to use in many places so didn't set collapsible to true at the very beginning. However, when I create a new instance of that, I set the collapsible to true at bottom. But it seems like its not working:(

sven
1 Sep 2010, 12:50 AM
then I add a Grid into my master layout container. when its showing up on the screen, it doesn't appear a button or something I can collapse my master layout container.

You add your grid directly to your container with a borderlayout? That wont work with collapsible. You need to put the Grid into a ContentPanel and this contentpanel has to be put into the container with the borderlayout.

phoboshero
1 Sep 2010, 7:53 PM
Yeah, after I change my master layout container to a content panel, its working now:)

Thank you!