-
20 Oct 2008 1:38 AM #1
layout problem in panel-header
layout problem in panel-header
Hello
I have problem with layout the tool (refresh, collapsible etc. ) in the header from panels.
I'm working with GXT 1.1.1.
Here is an example.
And here is my code:
-----------------------------------------------------------------------
public class Test implements EntryPoint {
private VerticalPanel vp;
public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FlowLayout());
vp = new VerticalPanel();
vp.setSpacing(10);
createColumnForm();
viewport.add(vp);
RootPanel.get().add(viewport);
}
private void createColumnForm() {
FormPanel panel = new FormPanel();
panel.setFrame(true);
// panel.setIconStyle("icon-form");
panel.setCollapsible(true);
panel.setHeading("FormPanel");
panel.setSize(470, -1);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setLayout(new FlowLayout());
ToolButton tbRefresh = new ToolButton("x-tool-refresh");
tbRefresh.addSelectionListener(new SelectionListener() {
@Override
public void componentSelected(ComponentEvent ce) {
}
public void handleEvent(BaseEvent be) {
Dispatcher.forwardEvent(AppEvents.REFRESH_FILE_LIST);
}
});
panel.getHeader().addTool(tbRefresh);
LayoutContainer main = new LayoutContainer();
main.setWidth(450);
main.setLayout(new ColumnLayout());
LayoutContainer left = new LayoutContainer();
FormLayout layout = new FormLayout();
layout.setLabelAlign(LabelAlign.TOP);
left.setLayout(layout);
TextField<String> first = new TextField<String>();
first.setFieldLabel("First Name");
left.add(first);
TextField<String> company = new TextField<String>();
company.setFieldLabel("Company");
left.add(company);
DateField birthday = new DateField();
birthday.setFieldLabel("Birthday");
left.add(birthday);
LayoutContainer right = new LayoutContainer();
layout = new FormLayout();
layout.setLabelAlign(LabelAlign.TOP);
right.setLayout(layout);
TextField<String> last = new TextField<String>();
last.setFieldLabel("Last");
right.add(last);
TextField<String> email = new TextField<String>();
email.setFieldLabel("Email");
right.add(email);
Radio radio1 = new Radio();
radio1.setBoxLabel("Yes");
Radio radio2 = new Radio();
radio2.setBoxLabel("No");
RadioGroup group = new RadioGroup();
group.setFieldLabel("Ext GWT User");
group.add(radio1);
group.add(radio2);
right.add(group);
main.add(left, new ColumnData(.5));
main.add(right, new ColumnData(.5));
panel.add(main);
LayoutContainer area = new LayoutContainer();
area.setStyleAttribute("padding", "0 10px 5px 10px");
area.setWidth(450);
layout = new FormLayout();
layout.setLabelAlign(LabelAlign.TOP);
layout.setPadding(0);
area.setLayout(layout);
TextArea a = new TextArea();
a.setFieldLabel("Comment");
String adj = GXT.isIE ? "100%" : "-20"; // looking into
a.setData("anchorSpec", adj);
area.add(a);
panel.add(area);
panel.addButton(new Button("Cancel"));
panel.addButton(new Button("Submit"));
vp.add(panel);
}
-----------------------------------------------------------------------
Is this a bug or what is wrong in my code?
Sorry, for my bad english.
-
20 Oct 2008 2:09 AM #2
make sure your doctype is html4.0 quirks mode
GXT JavaDocs: http://extjs.com/deploy/gxtdocs/
GXT FAQ & Wiki: http://extjs.com/learn/Learn_About_the_Ext_GWT_Library
Buy the Book on GXT: http://www.apress.com/book/view/9781430219408
Follow me on Twitter: http://twitter.com/gslender
-
20 Oct 2008 3:34 AM #3
hi gslender
thanks for your support.
I have<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">doctype in my html-file.
the error continous to exist (hostend-mode and web-mode).
-
20 Jan 2009 2:26 AM #4
The Probelm does not exist with GXt version 1.2.1 any longer.


Reply With Quote