Isomorphic ,
I noticed an issue with the DynamicForm clearing fields that have a null value if the form is redrawn due to an item changing. It only occurs when a scrollbar is introduced by the redraw. This results in the field not being included when saving the form data.
The following sample code reproduces the issue. You need to clear the text for Item 1 first and then change Item 2. You'll notice that when you choose "Scrollbar", Item 1 is cleared (i.e. reset to the default value).
I'm using the following:
SmartClient Version: v12.1p_2022-01-29/Pro Deployment (built 2022-01-29)
Stratus skin
Chrome 99.0.4844.74 (Official Build) (64-bit)
Thanks
I noticed an issue with the DynamicForm clearing fields that have a null value if the form is redrawn due to an item changing. It only occurs when a scrollbar is introduced by the redraw. This results in the field not being included when saving the form data.
The following sample code reproduces the issue. You need to clear the text for Item 1 first and then change Item 2. You'll notice that when you choose "Scrollbar", Item 1 is cleared (i.e. reset to the default value).
Code:
public void onModuleLoad() { DynamicForm form = new DynamicForm(); form.setNumCols(1); form.setTitleOrientation(TitleOrientation.TOP); TextItem item1 = new TextItem("item1", "Item 1"); item1.setDefaultValue("Clear this item first"); SelectItem item2 = new SelectItem("item2", "Item 2"); item2.setValueMap("Then change this", "No Scrollbar", "Scrollbar"); item2.setDefaultToFirstOption(Boolean.TRUE); item2.setRedrawOnChange(Boolean.TRUE); TextItem otherItem1 = new TextItem("otherItem1", "Other Item 1"); otherItem1.setStartRow(Boolean.TRUE); otherItem1.setShowIfCondition((i, v, f) -> "No Scrollbar".equals(item2.getValueAsString())); TextAreaItem otherItem2 = new TextAreaItem("otherItem2", "Other Item 2"); otherItem2.setStartRow(Boolean.TRUE); otherItem2.setShowIfCondition((i, v, f) -> "Scrollbar".equals(item2.getValueAsString())); form.setItems(item1, item2, otherItem1, otherItem2); Window w = new Window(); w.setCanDragResize(Boolean.TRUE); w.setHeight(200); w.setWidth(500); w.addItem(form); w.show(); }
SmartClient Version: v12.1p_2022-01-29/Pro Deployment (built 2022-01-29)
Stratus skin
Chrome 99.0.4844.74 (Official Build) (64-bit)
Thanks
Comment