Changeset 2410

Show
Ignore:
Timestamp:
03/14/2008 09:42:39 AM (10 months ago)
Author:
tof
Message:

Fixed #671, #721

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r2408 r2410  
    22============================ 
    33BUG: Ticket#636 - I18N catalogue problem (Christophe) 
     4BUG: Ticket#671 - TActiveCustomValidator Callback Problem (Christophe) 
    45BUG: Ticket#707 - TPropertyAccess sets property twice on object when using setters (Qiang) 
    56BUG: Ticket#719 - TAutoCompleter should not trigger Validation if CausesValidation=False (Christophe) 
     7BUG: Ticket#721 - TActiveCustomValidator + TValidationSummary problem (Christophe) 
    68BUG: Ticket#736 - Files never created in clientscript.php (Qiang) 
    79BUG: Ticket#744 - Callback error handling is improved (Qiang) 
  • trunk/framework/Web/Javascripts/source/prado/validator/validation3.js

    r2408 r2410  
    411411                } 
    412412 
    413                 var refresh = update || this.visible == false || this.options.Refresh != false; 
    414  
     413                var refresh = update || this.visible == false || this.options.Refresh != false;  
     414                // Also, do not refresh summary if at least 1 validator is waiting for callback response. 
     415                // This will avoid the flickering of summary if the validator passes its test 
     416                refresh = refresh && validators.any(function(v) { return !v.requestDispatched; }); 
     417                 
    415418                if(this.options.ShowSummary != false && refresh) 
    416419                { 
     
    11511154{ 
    11521155        validatingValue : null, 
    1153  
     1156        invoker : null, 
     1157 
     1158        /** 
     1159         * Override the parent implementation to store the invoker, in order to  
     1160         * re-validate after the callback has returned 
     1161         * Calls evaluateIsValid() function to set the value of isValid property. 
     1162         * Triggers onValidate event and onSuccess or onError event. 
     1163         * @param HTMLElement element that calls for validation 
     1164         * @return boolean true if valid. 
     1165         */ 
     1166        validate : function(invoker) 
     1167        { 
     1168                this.invoker = invoker; 
     1169                 
     1170                //try to find the control. 
     1171                if(!this.control) 
     1172                        this.control = $(this.options.ControlToValidate); 
     1173 
     1174                if(!this.control || this.control.disabled) 
     1175                { 
     1176                        this.isValid = true; 
     1177                        return this.isValid; 
     1178                } 
     1179 
     1180                if(typeof(this.options.OnValidate) == "function") 
     1181                { 
     1182                        if(this.requestDispatched == false) 
     1183                                this.options.OnValidate(this, invoker); 
     1184                } 
     1185 
     1186                if(this.enabled && !this.control.getAttribute('disabled')) 
     1187                        this.isValid = this.evaluateIsValid(); 
     1188                else 
     1189                        this.isValid = true; 
     1190 
     1191                // Only update the message if the callback has already return ! 
     1192                if (!this.requestDispatched) 
     1193                        this.updateValidationDisplay(invoker); 
     1194                         
     1195                this.observeChanges(this.control); 
     1196 
     1197                return this.isValid; 
     1198        }, 
     1199         
    11541200        /** 
    11551201         * Calls custom validation function. 
     
    11591205                value = this.getValidationValue(); 
    11601206                if(!this.requestDispatched && (""+value) != (""+this.validatingValue)) 
    1161                 //if((""+value) != (""+this.validatingValue)) 
    11621207                { 
    11631208                        this.validatingValue = value; 
     
    11831228                        this.options.onSuccess(request,data); 
    11841229                this.updateValidationDisplay(); 
     1230                this.manager.updateSummary(this.group); 
     1231                // Redispatch initial request if any 
     1232                if (this.invoker instanceof Prado.CallbackRequest) 
     1233                { 
     1234                        this.invoker.dispatch(); 
     1235                } 
     1236                 
    11851237        }, 
    11861238