PDA

View Full Version : [FIXED] BorderLayout: Heading of collapsed ContentPanel disappears



flow
4 Jun 2008, 8:24 AM
Hello,

Using:
GXT Beta 4
GWT 1.5 RC
Hosted Mode

I put a simple ContentPanel into the NORTH-region of a BorderLayout. The ContentPanel has a heading which is nicely rendered. On collapsing the northern region, the heading disappears.
My code:


package com.soko.multibase.client;

import com.extjs.gxt.ui.client.Style;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FillLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*
* @author huber, itestra GmbH
* @version $Id: ClientTest.java,v 1.1 2008/06/04 15:52:48 huber Exp $
*/
public class ClientTest implements EntryPoint {

/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Viewport viewport = new Viewport();
viewport.setLayout(new FillLayout());

final ContentPanel cp = new ContentPanel();

cp.setLayout(new BorderLayout());
cp.setHeaderVisible(false);

final ContentPanel northPanel = new ContentPanel();
northPanel.setHeading("North Panel");
northPanel.setFrame(true);
northPanel.setLayout(new FitLayout());
northPanel.add(new Html("<b>Big Text</b>"));

BorderLayoutData borderLayoutData = new BorderLayoutData(LayoutRegion.NORTH);
borderLayoutData.setSplit(true);
borderLayoutData.setCollapsible(true);
cp.add(northPanel, borderLayoutData);

// Center Panel
final ContentPanel centerContainer = new ContentPanel();
centerContainer.setFrame(true);
centerContainer.setHeading("Center");
centerContainer.setLayout(new FitLayout());
centerContainer.add(new Html("Center Text"));

borderLayoutData = new BorderLayoutData(Style.LayoutRegion.CENTER);
cp.add(centerContainer, borderLayoutData);

viewport.add(cp);
viewport.layout();
RootPanel.get().add(viewport);
}
}
I think, the collapse of a "BorderLayout"-element should behave as the collapse event on a ContentPanel, namely, preserve the heading.

Thanks for your help (if it's not a bug),

Flo~

darrellmeyer
5 Jun 2008, 10:48 AM
Fix is in SVN.

flow
5 Jun 2008, 11:23 PM
Thanks. Will wait eagerly for the next release ;)

flow
13 Jun 2008, 3:58 AM
Hi Darrell,

the heading still disappears. :-(
I added a line


borderLayoutData.setFloatable(false);

to workaround http://extjs.com/forum/showthread.php?t=34187