Announcement

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

    Wrong DynamicForm height when FormItemSection is hidden

    Hi
    We have DynamicForm which has at least one FormItemSection and it's items hidden. After upgrade from 3.1p to 5.0p the height of DynamicForm is not accommodating to expanded sections if one of the sections is set to be hidden.
    I was able to reproduce the issue in the Showcase - SmartClient Version: v10.0p_2016-06-08/LGPL Development Only (built 2016-06-08)

    First example is when all sections are visible. In this case everything works well.

    Code:
        public Canvas getViewPanel() {
    
            HLayout container = new HLayout();
            container.setWidth(350);
            container.setHeight(200);
            container.setOverflow(Overflow.AUTO);
            container.setBorder("1px solid black");
    
            final DynamicForm form = new DynamicForm();
            form.setWidth(300);
            form.setHeight("*");
    
            // Section 1
    
            TextItem itemName = new TextItem();
            itemName.setName("itemName");
            itemName.setTitle("Item");
    
            TextAreaItem descriptionItem = new TextAreaItem();
            descriptionItem.setName("descriptionItem");
            descriptionItem.setTitle("Description");
    
            TextItem priceItem = new TextItem();
            priceItem.setType("float");
            priceItem.setName("priceItem");
            priceItem.setTitle("Price");
            priceItem.setDefaultValue("low");
    
            SectionItem section1 = new SectionItem();
            section1.setDefaultValue("Section 1");
            section1.setSectionExpanded(true);
            section1.setItemIds("itemName", "descriptionItem", "priceItem");
    
            // Section 2
    
            FormItem textItem1 = new TextItem("foo");
    
            SectionItem section2 = new SectionItem();
            section2.setDefaultValue("Section 2");
            section2.setItemIds("foo");
    
            section2.setVisible(true);
            section2.setSectionExpanded(false);
            textItem1.setVisible(true);
    
            // Section 3
    
            FormItem textItem2 = new TextItem("bar");
    
            SectionItem section3 = new SectionItem();
            section3.setDefaultValue("Section 3");
            section3.setItemIds("bar");
    
            section3.setVisible(true);
            section3.setSectionExpanded(false);
            textItem2.setVisible(true);
    
            form.setFields(section1, itemName, descriptionItem, priceItem, section2, textItem1, section3, textItem2);
    
            container.addMember(form);
            return container;
        }
    Click image for larger version

Name:	sections-issue-all-visible.gif
Views:	87
Size:	57.5 KB
ID:	238541

    Now if we hide the last section, the height of the DynamicForm is not computed correctly when expanding 2nd section:
    Code:
            // Section 2
    
            FormItem textItem1 = new TextItem("foo");
    
            SectionItem section2 = new SectionItem();
            section2.setDefaultValue("Section 2");
            section2.setItemIds("foo");
    
            section2.setVisible(true);
            section2.setSectionExpanded(false);
            textItem1.setVisible(true);
    
            // Section 3
    
            FormItem textItem2 = new TextItem("bar");
    
            SectionItem section3 = new SectionItem();
            section3.setDefaultValue("Section 3");
            section3.setItemIds("bar");
    
            section3.setVisible(false);
            section3.setSectionExpanded(false);
            textItem2.setVisible(false);
    
            form.setFields(section1, itemName, descriptionItem, priceItem, section2, textItem1, section3, textItem2);
    Click image for larger version

Name:	sections-issue-last-hidden.gif
Views:	69
Size:	78.6 KB
ID:	238542

    The same happens we decide to hide 2nd section and expand 3rd one:
    Code:
            // Section 2
    
            FormItem textItem1 = new TextItem("foo");
    
            SectionItem section2 = new SectionItem();
            section2.setDefaultValue("Section 2");
            section2.setItemIds("foo");
    
            section2.setVisible(false);
            section2.setSectionExpanded(false);
            textItem1.setVisible(false);
    
            // Section 3
    
            FormItem textItem2 = new TextItem("bar");
    
            SectionItem section3 = new SectionItem();
            section3.setDefaultValue("Section 3");
            section3.setItemIds("bar");
    
            section3.setVisible(true);
            section3.setSectionExpanded(false);
            textItem2.setVisible(true);
    
            form.setFields(section1, itemName, descriptionItem, priceItem, section2, textItem1, section3, textItem2);
    Click image for larger version

Name:	sections-issue-middle-hidden.gif
Views:	76
Size:	59.0 KB
ID:	238543

    #2
    We're seeing this issue only in new versions of Firefox, and only for 5.0 - it's not reproducible in 5.1 or 6.0.

    Can you simply move to a more recent version (5.1, or ideally 6.0)? It doesn't make sense to do a migration to a new version, but pick a branch two releases behind the current stable version.
    Last edited by Isomorphic; 9 Jun 2016, 14:20.

    Comment


      #3
      Yes, I forgot to mention that it is not working only in FF.

      For sure, we plan to continue upgrading to the latest versions, but it is not so straightforward. We have to make proper testing, fixing all possible warnings and errors. And all this we have to do while we are still delivering high priority business tasks. And on top on this, multiple teams are working on the app, so it take more effort to synchronize with them. We were glad to finally jump from 3.1 at least to 5.0, but now this issue is blocker for us and if we will not be able to get fix from you, nor to deliver some workaround, we are going to be stuck with 3.1p for much longer.

      Please, let us know if it is possible to port the fix to 5.0 branch.
      Thanks

      Comment


        #4
        This is a confusing response.. there can be significant effort involved in verifying your code on a new version, that's true. However, you are currently in the middle of dealing with an already-fixed bug, which you only encountered because you aren't on the latest dot release for the 5.0 series. This is likely to be one of several bugs you'll encounter that are already fixed in the dot release.

        Comment


          #5
          I understand your point of view, but for now the situation is at it is.

          Please, make a decision if you are going to fix this bug in 5.0 branch or not.

          Comment


            #6
            We made a change yesterday to address this issue (should be present in the latest nightly build dated June 14).

            Regards
            Isomorphic Software

            Comment


              #7
              I used build from 2016-06-15 and it's working.
              Thanks

              Comment

              Working...
              X