1. #1
    Ext Premium Member
    Join Date
    Oct 2008
    Posts
    7
    Vote Rating
    0
    rotschi is on a distinguished road

      0  

    Default 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.
    Attached Images

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    4
    gslender is on a distinguished road

      0  

    Default


    make sure your doctype is html4.0 quirks mode

  3. #3
    Ext Premium Member
    Join Date
    Oct 2008
    Posts
    7
    Vote Rating
    0
    rotschi is on a distinguished road

      0  

    Default


    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).

  4. #4
    Ext Premium Member
    Join Date
    Oct 2008
    Posts
    7
    Vote Rating
    0
    rotschi is on a distinguished road

      0  

    Default


    The Probelm does not exist with GXt version 1.2.1 any longer.

Thread Participants: 1