Ticket #5329 (closed defect: fixed)

Opened 12 months ago

Last modified 12 months ago

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

Reported by: guest Owned by: doughays
Priority: normal Milestone: 1.1
Component: Dijit Version: 1.0
Severity: normal Keywords:
Cc:

Description

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

Changed 12 months ago by bill

  • owner set to doughays
  • milestone set to 1.1

Changed 12 months ago by doughays

  • status changed from new to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.