Announcement

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

    DynamicForm is drawn wider than neccessary in 6.1d causing a scrollbar (test case)

    We are in the middle of evaluating the 6.1 version of SmartGWT, and so far so good. I am experiencing however an annoying rendering behavior in dynamic forms under certain situations. For instance, if you run the test case below in any browser, a window pops up with a dynamic form embedded in it. The dynamic form extends unnecessarily beyond the boundaries of the window causing a horizontal scroll bar to appear, even though the items in the form are not too wide to require that much horizontal space. No resizing of the window make the scroll bar to go away. I noticed that this only happens when I use "*" in the setColWidths() call. This used to work correctly in the 6.0 version.


    SamrtGWT version: SmartClient Version: SNAPSHOT_v11.1d_2017-05-17/LGPL Development Only (built 2017-05-17)
    GWT: 2.8.1

    Code:
            final DynamicForm form0 = new DynamicForm();
            descriptiveName = new TextItem("Account_NAME", "Descriptive name:");
            descriptiveName.setWrapTitle(false);
            descriptiveName.setRequired(true);
            descriptiveName.setEndRow(false);
            descriptiveNameExplanationLabel = new StaticTextItem("descriptiveNameExplanationLabel");
            descriptiveNameExplanationLabel.setShowTitle(false);
            descriptiveNameExplanationLabel.setDefaultValue("Name to distinguish this account.");
            descriptiveNameExplanationLabel.setStartRow(false);
            descriptiveNameExplanationLabel.setEndRow(true);
            form0.setNumCols(3);
            form0.setColWidths(100, 100, "*");  // This causes the form to extend horizontally beyond the edge of the window.
            
            form0.setFields(descriptiveName, descriptiveNameExplanationLabel);
          
            
            Window win = new Window();
            win.setCanDragResize(true);
            win.setWidth("80%");
            win.setHeight("50%");
            win.centerInPage();
            win.addItem(form0);
            
            win.show();

    #2
    It looks like you just need to setWidth100() on your form, to have it fill it's window - there's no specified width anywhere and the last column is width "*".

    Comment


      #3
      Tried that (form.setWith100(). It didn't make any difference. I even tried a "90%" width on the form. The srcoll bar still shows.

      Thanks,
      Mike

      Comment


        #4
        Ok,we see the problem and it'll be looked into in the next day or so.

        In the meantime, you can prevent the scrollbar by just applying a width to your staticTextItem - any arbitrary value will do, setWidth(1), for example - it just needs *a* value to skip the framework logic that's resizing the item too wide.

        Comment

        Working...
        X