Opened 11 years ago

Closed 11 years ago

Last modified 8 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:

Description

See http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-development-discussion/datetimetextbox-getvalue-setvalue-incompatible-fo

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 11 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 8 years ago by bill

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