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.
Now if we hide the last section, the height of the DynamicForm is not computed correctly when expanding 2nd section:
The same happens we decide to hide 2nd section and expand 3rd one:
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; }
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);
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);
Comment