Changeset 11779

Show
Ignore:
Timestamp:
12/10/07 14:46:26 (9 months ago)
Author:
doughays
Message:

Fixes #5329. Check for value === null in textbox:setValue and make sure parse and format do not return null.

Location:
dijit/trunk/form
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/form/TextBox.js

    r11765 r11779  
    4747                setValue: function(value, /*Boolean, optional*/ priorityChange, /*String, optional*/ formattedValue){ 
    4848                        var filteredValue = this.filter(value); 
    49                         if((typeof filteredValue == typeof value) && (formattedValue == null || formattedValue == undefined)){ 
     49                        if(((typeof filteredValue == typeof value) || (value === null/*#5329*/)) && (formattedValue == null || formattedValue == undefined)){ 
    5050                                formattedValue = this.format(filteredValue, this.constraints); 
    5151                        } 
  • dijit/trunk/form/TimeTextBox.js

    r11130 r11779  
    1818                compare: dojo.date.compare, 
    1919                format: function(/*Date*/ value, /*Object*/ constraints){ 
    20                         if(!value || value.toString() == this._invalid){ return null; } 
     20                        if(!value || value.toString() == this._invalid){ return ''; } 
    2121                        return dojo.date.locale.format(value, constraints); 
    2222                }, 
    23                 parse: dojo.date.locale.parse, 
     23                parse: function(/*String*/ value, /*Object*/ constraints){ 
     24                        return dojo.date.locale.parse(value, constraints) || undefined; /* can't return null to getValue since that's special */ 
     25                }, 
     26 
    2427                serialize: dojo.date.stamp.toISOString, 
    2528