PDA

View Full Version : [CLOSED] Top component glitch in a framed FormPanel



zaccret
30 May 2008, 3:53 AM
Env : Windows XP, GXT 1.0beta3, IE6, FF2/3
When I set a top component on a "framed" (setFrame(true)) form panel (a toolbar, for example), the toolbar doesn't take all the panel width, and the bottom border is missing.

public void onModuleLoad() {
Viewport viewport = new Viewport();
final FormPanel panel = new FormPanel();
panel.setFrame(true);
panel.setHeading("Form panel");
panel.setWidth(400);
panel.setTopComponent(new ToolBar());
final TextField<String> field = new TextField<String>();
field.setFieldLabel("File");
panel.add(field);
viewport.add(panel);
RootPanel.get().add(viewport);
}

darrellmeyer
2 Jun 2008, 10:02 PM
When "framing" the content has a margin, therefore, the toolbar will not take up the full width. The border needs to be applied to the body element the panel's children do not have a border themselves.


public void onModuleLoad() {
Viewport viewport = new Viewport();
final FormPanel panel = new FormPanel();
panel.setBodyStyle("border: 1px solid black");
panel.setFrame(true);
panel.setHeading("Form panel");
panel.setWidth(400);
panel.setTopComponent(new ToolBar());
final TextField<String> field = new TextField<String>();
field.setFieldLabel("File");
panel.add(field);
viewport.add(panel);
RootPanel.get().add(viewport);
}

zaccret
9 Jun 2008, 10:23 PM
Ok for toolbar width, but the toolbar looks bordered except for bottom. Take a look at the screenshot. Is that normal ?

darrellmeyer
10 Jun 2008, 6:05 AM
Yes, it looks normal and I provided a way for you to add the border in my previous post.


panel.setBodyStyle("border: 1px solid black");