The_Jackal
14 Apr 2009, 5:19 PM
I made a viewport with center and south panels. I set the south panel to be initially collapsed with southPanel.collapse(). The bug is that it can not be expanded.
Clicking on the expand button has no effect. Also note that the button is still in "expanded" state (image has arrows facing down).
The collapse method appears to have different behaviour if the ContentPanel is not rendered. Perhaps this causes the issue?
Environment: GWT 1.5, Hosted mode, FireFox and IE
The code to recreate:
public class ContentPanelBug implements EntryPoint
{
public void onModuleLoad()
{
ContentPanel centerPanel = new ContentPanel();
centerPanel.setHeading("Center Panel");
ContentPanel southPanel = new ContentPanel();
southPanel.setHeading("South Panel");
// This line causes the panel to be permanently collapsed - can not expand it
southPanel.collapse();
Viewport viewport = new Viewport();
final BorderLayout borderLayout = new BorderLayout();
viewport.setLayout(borderLayout);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(5, 0, 5, 0));
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 150);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(5));
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 50);
southData.setSplit(true);
southData.setCollapsible(true);
southData.setMargins(new Margins(0, 5, 5, 5));
viewport.add(centerPanel, centerData);
viewport.add(southPanel, southData);
RootPanel.get().add(viewport);
}
}
Note: if the southPanel.collapse() is moved to the last line (after the RootPanel call) then the panel is expandable but this is an inconvenient place to put it (for example if the view creation code is in another class).
Clicking on the expand button has no effect. Also note that the button is still in "expanded" state (image has arrows facing down).
The collapse method appears to have different behaviour if the ContentPanel is not rendered. Perhaps this causes the issue?
Environment: GWT 1.5, Hosted mode, FireFox and IE
The code to recreate:
public class ContentPanelBug implements EntryPoint
{
public void onModuleLoad()
{
ContentPanel centerPanel = new ContentPanel();
centerPanel.setHeading("Center Panel");
ContentPanel southPanel = new ContentPanel();
southPanel.setHeading("South Panel");
// This line causes the panel to be permanently collapsed - can not expand it
southPanel.collapse();
Viewport viewport = new Viewport();
final BorderLayout borderLayout = new BorderLayout();
viewport.setLayout(borderLayout);
BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
centerData.setMargins(new Margins(5, 0, 5, 0));
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 150);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(5));
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 50);
southData.setSplit(true);
southData.setCollapsible(true);
southData.setMargins(new Margins(0, 5, 5, 5));
viewport.add(centerPanel, centerData);
viewport.add(southPanel, southData);
RootPanel.get().add(viewport);
}
}
Note: if the southPanel.collapse() is moved to the last line (after the RootPanel call) then the panel is expandable but this is an inconvenient place to put it (for example if the view creation code is in another class).