Opened 13 years ago

Closed 13 years ago

Last modified 10 years ago

#6922 closed defect (fixed)

Form: getValues()/setValues() won't restore blank DateTextBox

Reported by: bill Owned by: Douglas Hays
Priority: high Milestone: 1.2
Component: Dijit - Form Version: 1.1.1
Keywords: Cc:
Blocked By: Blocking:



If no value has been set for a DateTextBox, Form.getValue()s is passed an undefined value by DateTextBox.getValue(). This serializes to JSON OK, as "Mydate": undefined, and de-serializes back to an undefined value. However when Form.setValues passes this on to _DateTimeTextBox.setValue, it is essentially ignored - if there is already a value set in the control, it remains there rather than being unset as you would expect (and this is true whether it has been converted to and from JSON, or the value retrieved by getValues is supplied directly back to setValues).

Same root cause as #6827 but listing as a separate ticket since it's a different manifestation.

Change History (2)

comment:1 Changed 13 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [14346]) Fixes #6827, #6922 !strict. blank values for date/time/number textboxes generate null(NaN for numbertextbox) for getValue/onChange, while gibberish generates undefined so that setValue(undefined) can be used to not modify the existing textbox value, while setValue(null) will blank out the textbox. Added tests to test_validate.html for numbertextbox and to test_datetextbox.html for datetextbox.

comment:2 Changed 10 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.