Announcement

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

    Item width and colspan on DynamicForm

    I would like to report a problem with width of form items that was set to "*".
    When you use colspan, width of an item is shorter than it should be. Cellpadding is not considered.
    Example:
    Code:
    DynamicForm form = new DynamicForm();
    form.setCellPadding(4);
    form.setNumCols(4);
    form.setColWidths(80, "*", 100, 150);
    
    TextItem item1 = new TextItem("item1");
    item1.setWidth("*");
    item1.setEndRow(false);
    
    ButtonItem button = new ButtonItem();
    button.setWidth(100);
    button.setHeight(24);
    button.setStartRow(false);
    
    TextItem item2 = new TextItem("item2");
    item2.setWidth("*");
    item2.setColSpan(2);
    
    form.setFields(item1, button, item2);
    When you change:
    Code:
    form.setCellPadding(0);
    Width of TextItem is OK.

    Best regards
    Mariusz Goch

    #2
    What was the expected size and observed size?

    How did you measure the size?

    What version are you using?

    What browser and skin?

    Comment


      #3
      Expected size was full available width on form.
      And observed with Firebug.
      Missing width is exactly amount of padding space between spanned elements.

      In previous example another ButtonItem is missing or amount of columns should be decreased.
      Code:
      form.setNumCols(3);
      form.setColWidths(80, "*", 100);
      Checked on several skins including clean Enterprise.
      SmartGWT version 3.1 from last month and today nightly.
      Web browser: Firefox and Chrome.
      Last edited by pH4Lk0n; 9 Jan 2013, 12:31.

      Comment


        #4
        For clarity, please give the pixel value you expected. Your prose description still leaves room for misinterpretation.

        Also, you answered only one of several questions.

        Comment


          #5
          I've attached screenshot for this values:
          Code:
          form.setPadding(8);
          form.setCellPadding(4);
          form.setNumCols(4);
          form.setColWidths(80, "*", 100, 100);
          Missing width: 2 * 2 * 4px = 16px
          Number of buttons * number of sides * cellpadding.

          Checked on several skins including clean Enterprise.
          SmartGWT version 3.1 from last month and today nightly.
          Web browser: Firefox and Chrome.
          Attached Files

          Comment


            #6
            Thanks for the clarifications. We see the effect and have it assigned to a developer for investigation.

            Regards
            Isomorphic Software

            Comment


              #7
              We've addressed this in 3.1p and 4.0d - please retest with a nightly build of January 13 or later.

              Comment


                #8
                It looks OK now.
                Best regards
                Mariusz Goch

                Comment


                  #9
                  Hi Mariusz,
                  We have revisited this area and realized that actually there's a problem in the test case.
                  You have a column with width specified as 100px, and a button in it, with size set to 100px.
                  In the 3.1p branch when a ButtonItem has a specified pixel size, the actual button will render at that size - it won't leave space for padding etc - so in this case it's essentially widening the column it's embedded in.

                  If you specify the ButtonItem with a width of "*" the button will be sized to the inner-width rather than the total width of the column and things should align properly.

                  Regards
                  Isomorphic Software

                  Comment


                    #10
                    Hi,

                    Thank you for pointing this out.
                    I've checked with multiple buttons and width was not right with last solution but after changing width to "*" it looks ok.

                    Best regards
                    Mariusz Goch

                    Comment

                    Working...
                    X