Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

why can't I size my DynamicForm?

$
0
0
SmartClient Version: v9.1p_2014-03-20/PowerEdition Deployment (built 2014-03-20)
GWT 2.5.1
IE-11

I'm having difficulty getting my DynamicForm to size properly. It wants to expand horizontally far beyond what I specified for width. This in turn is causing a horizontal scroll bar in the window for no reason. Please see the testcase below along with the screen shot attached.

This was OK in SmartGWT 2.x but seems to have broke when we upgraded to SmartGWT 4.x.

Code:

    public void testcase6() {
        CheckboxItem preLoadCheckbox;
        Button cancelButton = new Button("Cancel");
        Button okButton = new Button("Ok");
        okButton.setWidth(60);
        cancelButton.setWidth(60);

        ListGrid listGrid =  new ListGrid();

        DynamicForm form = new DynamicForm();

        form.setWidth(70); // PROBLEM - this causes the scroll bar on the bottom of the window, uncomment the next line to see.
        form.setBackgroundColor("pink");
        form.setTitleWidth(0);
        form.setPadding(0);

        preLoadCheckbox = new CheckboxItem();
        preLoadCheckbox.setTitle("Pre-Load");
        preLoadCheckbox.setTitleColSpan(0);
        preLoadCheckbox.setTitleOrientation(TitleOrientation.RIGHT);
        form.setFields(preLoadCheckbox);

        HLayout hLayout = new HLayout();
//            hLayout.setWidth100();  //taking this out did not help the PROBLEM above
        hLayout.setMembersMargin(4);
        hLayout.setLayoutMargin(2);
        hLayout.addMember(okButton);
        hLayout.addMember(cancelButton);
        hLayout.addMember(form);

        VLayout vLayout = new VLayout();
        vLayout.addMember(listGrid);
        vLayout.addMember(hLayout);

        window = new Window();
        window.setShowHeader(Boolean.FALSE);
        window.setWidth(224);
        window.setHeight("30%");
        window.setIsModal(Boolean.TRUE);
        window.setCanDragReposition(Boolean.FALSE);
        window.setCanDragResize(Boolean.FALSE);
        window.setShowModalMask(Boolean.TRUE);
        window.setShowShadow(Boolean.TRUE);
        window.addItem(vLayout);
        window.show();
    }


Attached Images
File Type: jpg DynamicFormIssue.jpg (10.8 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles