SmartClient Version: v12.0p_2018-05-26/AllModules Development Only (built 2018-05-26)
Chrome on OSX
Please try sample in the showcase:
The 'Switch' button toggles the 'test' form item between two different value maps. You may notice that after the first click, the value isn't set. Only in the next clicks it appears to work correctly.
Chrome on OSX
Please try sample in the showcase:
Code:
isc.VLayout.create({ height: 600, width: 600, align: "center", defaultLayoutAlign: "center", members: [ isc.DynamicForm.create({ ID: "testForm", autoFocus: true, items: [ { type: "text", name: "test", selectOnFocus: true, value: 1, valueMap: {1: "Yes", 2: "No"}, standardValueMap: {1: "Yes", 2: "No"}, customValueMap: {1: "foo", 2: "bar"}, showsStandard: true, wrapTitle: false, editorType: "RadioGroupItem" } ] }), isc.Button.create({ title: "Switch", autoFit: true, click: function () { var myField = testForm.getField("test"); var value = myField.getValue(); if (myField.showsStandard) { myField.setValueMap(myField.customValueMap); } else { myField.setValueMap(myField.standardValueMap); } myField.showsStandard = !myField.showsStandard; myField.setValue(value); return true; } }) ] });
Comment