Changes between Version 2 and Version 3 of Ticket #7381, comment 5


Ignore:
Timestamp:
Nov 12, 2012, 1:57:00 AM (10 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7381, comment 5

    v2 v3  
    33'''Back-compat:'''
    44
    5 One stumbling block changing the behavior would be for things like this simplified example:
     5There are a number of back-compat issues with changing this in 1.x, including:
     6
     71) dependent properties
     8
     9In for example !ComboBox, {{{new ComboBox({value: "foo"}) is problematic because set("value", "foo") will be called but also set("item", null) will be called, and the latter will override the first.   Although we have code to make sure that parameters to the constructor are executed after default setters, I'm seeing this manifest itself on IE8 (but for some timing reason not on FF) where the first !ComboBox in test_ComboBox.html ends up with a blank value.
     10
     112) inherited setters
     12
     13Classes like Button define a _setValueAttr that accesses this.valueNode.    Subclasses like !ScrollingTabControllerMenuButton inherit that setter, but don't define this.valueNode.    Thus you get an exception.
     14
     15Many of these cases can be handled in _WidgetBase _applyAttributes() by checking if the attach point is set or not, but that won't handle the case of actual custom setters (in dijit or customer code) like:
     16
     17{{{
     18_setValueAttr: function(){
     19   this.valueNodeAttr = ...
     20}
     21}}}
     22
     23
     243) existing setters that don't work with falsy value
     25
     26For example:
    627
    728{{{
     
    1435If _setDirAttr("") were called at construction, it would set this.domNode.dir to "", an invalid value.    The correct behavior is to not set the dir attribute at all, or better, to call removeAttribute("dir").    There were a bunch of attributes like that, especially relating to form widgets.
    1536
    16 
    17 ----
    18 
    19 PS: nowadays though _WidgetBase has the nonEmptyAttrToDom() factory, used like
     37Nowadays though _WidgetBase has the nonEmptyAttrToDom() factory, used like
    2038
    2139{{{