Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    why can't I size my DynamicForm?

    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 Files

    #2
    The CheckBoxItem has a default with of 150, which is overflowing the form.
    You could specify an explicit width, or a width of "*" to fit within the form, or set overflow to hidden to clip the item.

    Regards
    Isomorphic Software

    Comment


      #3
      Great, setWidth("*") worked. Thanks.

      Comment

      Working...
      X