Changeset 1430

Show
Ignore:
Timestamp:
23/12/09 14:19:22 (3 months ago)
Author:
karel
Message:

Don't validate disabled controls

Files:

Legend:

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

    r1397 r1430  
    12451245     */ 
    12461246    Control.prototype.newValidation = function(value, wireValue){ 
     1247        if (this.operationalState == Control.STATE_DISABLED) { 
     1248            this.valueState = Control.STATE_VALID; 
     1249            return; 
     1250        } 
    12471251        if (this.getType().validators.length == 0) { 
    12481252            // if there are no validators then we must assume that the control is valid 
     
    14761480        } 
    14771481        this.operationalState = Control.STATE_ENABLED; 
     1482        // If the control isn't in STATE_INIT, we should re-validate to restore validation messages that may have been present when disable() was called 
     1483        if (this.valueState != Control.STATE_INIT) { 
     1484          this.newValidation(this.getValue(), this.getWireValue()); 
     1485        }; 
    14781486    } 
    14791487     
     
    14891497            el.addClass("disabled"); 
    14901498        } 
     1499        this.clearMessage(); 
    14911500        this.operationalState = Control.STATE_DISABLED; 
    14921501    }