Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#5329 closed defect (fixed)

ValidationTextBox no longer accepts setValue(null) to clear the input value

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: Cc:
Blocked By: Blocking:


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)

comment:1 Changed 14 years ago by bill

Milestone: 1.1
Owner: set to Douglas Hays

comment:2 Changed 14 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [11779]) Fixes #5329. Check for value === null in textbox:setValue and make sure parse and format do not return null.

comment:3 Changed 11 years ago by bill

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