A select box with allowEmptyValue: true and redrawOnChange: true will be discarded from the form/value manager when the empty value is chosen. See the difference in the example below between redrawOnChange set to true (field 'ship1') or false (field 'ship2'). Change both select boxes to empty, press "Submit" and check the console output: 'ship1' is mistakenly not included in vm.getValues() when the empty value is chosen, 'ship2' is correctly included with its empty value.
Note: I edited the bug report to clarify the issue, it occurs when you set the select boxes to empty which had an old value != null.
Code:
isc.ValuesManager.create({ ID: "vm" }); isc.VLayout.create({ width: 400, height: 300, membersMargin: 10, members : [ isc.TabSet.create({ ID: "theTabs", height: 250, tabs: [ {title:"Item", pane: isc.DynamicForm.create({ ID: "form0", valuesManager:"vm", fields: [ {name: "itemName", type:"text", title:"Item"}, {name: "description", type:"textArea", title:"Description"}, {name:"price", type:"float", title: "Price"} ] }) }, {title:"Stock", pane: isc.DynamicForm.create({ ID: "form1", valuesManager:"vm", fields: [ {name: "inStock", type:"checkbox", title:"In Stock"}, {name: "ship1", type: "select", allowEmptyValue: true, emptyDisplayValue: "Choose shipment:", valueMap: {train: "Train", boat: "Boat"}, redrawOnChange: true}, {name: "ship2", type: "select", allowEmptyValue: true, emptyDisplayValue: "Choose shipment:", valueMap: {train: "Train", boat: "Boat"}}, {name: "nextShipment", type:"date", title:"Next Shipment", useTextField:"true", showIf: "form1.getValue('ship1') != null" } ] }) } ] }), isc.Button.create({ title:"Submit", click : function () { vm.validate(); if (form1.hasErrors()) theTabs.selectTab(1); else theTabs.selectTab(0); console.log(vm.getValues()); } }) ] }); vm.setValues({ship1: "train", ship2: "boat"});
Comment