ValidationTextBox no longer accepts setValue(null) to clear the input value
We're using form.setValues() to populate the fields of an input form with values received from the server in JSON format. Some values may be null. At 0.9, the text boxes for fields with null values were cleared. At 1.0, this no longer happens. If a field has a null value, the corresponding text box is not changed.
The problem seems to be the changes that were made to the setValue mathod in dijit/form/TextBox.js, line 51. If the parameter 'value' is null, the filter method returns an empty string, so the test (typeof filteredValue == typeof value) returns false. As a result, the 'formattedValue' parameter is not set, and the textbox value is not changed.
Change History (3)
Milestone: |
→ 1.1
|
Owner: |
set to Douglas Hays
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Component: |
Dijit →
Dijit - Form
|
(In [11779]) Fixes #5329. Check for value === null in textbox:setValue and make sure parse and format do not return null.