PDA

View Full Version : Issues with Multiple Vertically Stacked Widgets using Border Layout



jcorbin
20 May 2009, 7:29 AM
Hello,

I'm using JDK1.5.x, GWT 1.5.3, GXT 1.2.4.

I created a custom widget derived from CompositeWidget that has a LayoutContainer with a BorderLayout that contains three (3) Content Panels, one for the West, Center and East region respectively.

I then multiple instances of my custom widgets in the following manner,

Viewport viewPort = new Viewport();
viewPort.setLayout(new FitLayout());

ContentPanel mainPanel = new ContentPanel();
mainPanel.setLayout(new RowLayout(Orientation.VERTICAL));
mainPanel.setBorders(false);
mainPanel.setHeaderVisible(false);
mainPanel.setFrame(true);
mainPanel.setCollapsible(true);

mainPanel.add(new PositionWidget(), new RowData(1, 150,new Margins(0,4,0,4)));
mainPanel.add(new PositionWidget(), new RowData(1, 150, new Margins(4)));
mainPanel.add(new PositionWidget(), new RowData(1, 150, new Margins(0,4,0,4)));


viewPort.add(mainPanel);
RootPanel.get().add(viewPort);

They render for the most part okay, but when I compile and run them in the browser and collapse one of the widgets east panel content and then click the mouse anywhere in the collapsed east region, the "easts content panel" overlaps the center region. I've attached a screen shot for clarity.

Any ideas?

sven
20 May 2009, 7:32 AM
Please post a complete testcase as the forumguidelines tell you.

jcorbin
20 May 2009, 7:36 AM
I thought that is what I included, the entire content of my onModuleLoad, but here it is again.

Also, this behavior is reproducible in both hosted and browser mode.

public void onModuleLoad() {

Viewport viewPort = new Viewport();
viewPort.setLayout(new FitLayout());

ContentPanel mainPanel = new ContentPanel();
mainPanel.setLayout(new RowLayout(Orientation.VERTICAL));
mainPanel.setBorders(false);
mainPanel.setHeaderVisible(false);
mainPanel.setFrame(true);
mainPanel.setCollapsible(true);

mainPanel.add(new PositionWidget(), new RowData(1, 150,new Margins(0,4,0,4)));
mainPanel.add(new PositionWidget(), new RowData(1, 150, new Margins(4)));
mainPanel.add(new PositionWidget(), new RowData(1, 150, new Margins(0,4,0,4)));


viewPort.add(mainPanel);
RootPanel.get().add(viewPort);
}

Here is the definition of my PositionWidget,

public class PositionWidget extends Composite {

private static final int DEFAULT_PANEL_SPACING = 1;
public PositionWidget() {
LayoutContainer c = new LayoutContainer();
c.setLayout(new BorderLayout());
createLeftPanel(c);
createCenterPanel(c);
createRightPanel(c);

initComponent(c);

}

private void createLeftPanel(LayoutContainer c) {
ContentPanel panel = new ContentPanel();
panel.setBorders(true);
setShim(true);
panel.add(new Label("Left Panel"));

BorderLayoutData data = new BorderLayoutData(LayoutRegion.WEST);
data.setSplit(true);
data.setCollapsible(true);
data.setMargins(new Margins(DEFAULT_PANEL_SPACING));
c.add(panel, data);
}

private void createCenterPanel(LayoutContainer c) {
ContentPanel panel = new ContentPanel();
panel.setBorders(true);
panel.setShim(true);
panel.add(new Label("Center Panel"));

BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);
data.setMargins(new Margins(DEFAULT_PANEL_SPACING));
c.add(panel, data);
}

private void createRightPanel(LayoutContainer c) {
ContentPanel panel = new ContentPanel();
panel.setBorders(true);
panel.add(new Label("Right Panel"));
panel.setShim(true);
BorderLayoutData data = new BorderLayoutData(LayoutRegion.EAST);
data.setCollapsible(true);
data.setSplit(true);
data.setMargins(new Margins(DEFAULT_PANEL_SPACING));
c.add(panel, data);
}



}

jcorbin
20 May 2009, 9:05 AM
Sven,

Any thoughts?

sven
20 May 2009, 9:15 AM
That is a feature and not a bug. CLOSED.

Also please note that there is no reason to bump i thread after a few hours.

jcorbin
20 May 2009, 9:22 AM
Ummm, its not a feature. If I expand the west region after its collapsed and the panel is visible, the borders around the content for the west region disappears. How is that a feature??

If you cannot help me then please provide someone else's name that can.

Thanks,
J.D.

sven
20 May 2009, 9:24 AM
If you want to expand it again, than you have to click the expand tool. Clicking anywhere else will bring up a floating window.

jcorbin
20 May 2009, 9:29 AM
You are not following me. When I expand it after the floating content window is displayed, the content window disappears, but my borders around the content in the west region (after expansion) no longer renders the borders. Could you please try my code in your local environment and you will see to what I refer.

J.D.

sven
20 May 2009, 9:32 AM
This is something completly different than your image shows and you are describing in your first post.

sven
20 May 2009, 9:43 AM
The second reported issue will be fixed with 1.2.5

jcorbin
20 May 2009, 10:09 AM
LOL...I was trying to describe the issue. Need to work on your people skills.

Also, the issue with the borders disappearing also happens with GWT 1.6.4 and GXT 2.0 M2.