Changeset 1481


Ignore:
Timestamp:
2010-04-01 13:59:29 (3 years ago)
Author:
freya
Message:

bugfix: reading initial properties from implicit fconf caused strange side effects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/control.js

    r1479 r1481  
    208208            store.addTypeAndControl(index, $this.attr(ControlElements.ATTR_TYPE), $this.attr(ControlElements.ATTR_CONTROL)); 
    209209             
    210             var valueAttr = $this.attr("value"); 
    211             var disabledAttr = $this.attr("disabled"); 
    212             var typeAttr = $this.attr("type"); 
    213  
    214             if(valueAttr || disabledAttr || typeAttr) { 
    215                 var initial = {}; 
    216                 initial.value = valueAttr; 
    217                 initial.disabled = disabledAttr; 
    218                 initial.type = typeAttr; 
    219                 store.addInitialProperties(index, initial); 
     210            if(!forceReIndexing) { 
     211                var valueAttr = $this.attr("value"); 
     212                var disabledAttr = $this.attr("disabled"); 
     213                var typeAttr = $this.attr("type"); 
     214     
     215                if(valueAttr || disabledAttr || typeAttr) { 
     216                    var initial = {}; 
     217                    initial.value = valueAttr; 
     218                    initial.disabled = disabledAttr; 
     219                    initial.type = typeAttr; 
     220                    store.addInitialProperties(index, initial); 
     221                } 
    220222            } 
    221223        }; 
     
    341343                if (this.elementIndex[index].initial){ 
    342344                    type['control'] = type['control'] || {}; 
     345                     
    343346                    if(!type['control'].base){ 
    344347                        // if base type of control is not filled in : default to control of fieldtype 
    345348                        var fieldtype = this.fieldTypes.get(type['base']); 
    346                         var control = (new fieldtype).control; 
    347                         type['control'].base = control; 
     349                        var controlType = (new fieldtype).control; 
     350                        type['control'].base = controlType; 
    348351                    } 
    349352                    type['control']['initial'] = this.elementIndex[index].initial;     
Note: See TracChangeset for help on using the changeset viewer.