summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-10-19 00:20:00 +0000
committerwei <>2006-10-19 00:20:00 +0000
commitec1c561946e785fb34a4809b8b154e2e4f0ffb8b (patch)
treebd8689cea68ed21df492f68f58d7b1647f74cf89
parent80c82147fc8143eb45ef2000a49fabac889a1615 (diff)
fixed onFailure and onSuccess in TActiveCustomValidator
-rw-r--r--framework/Web/Javascripts/js/compressed/validator.js6
-rw-r--r--framework/Web/Javascripts/js/debug/validator.js4
-rw-r--r--framework/Web/Javascripts/prado/validation3.js4
3 files changed, 12 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/js/compressed/validator.js b/framework/Web/Javascripts/js/compressed/validator.js
index 088d6adf..cca77a81 100644
--- a/framework/Web/Javascripts/js/compressed/validator.js
+++ b/framework/Web/Javascripts/js/compressed/validator.js
@@ -189,8 +189,10 @@ return true;}});Prado.WebUI.TActiveCustomValidator=Class.extend(Prado.WebUI.TBas
{value=this.getValidationValue();if(!this.requestDispatched&&value!=this.validatingValue)
{this.validatingValue=value;request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.setCallbackParameter(value);request.setCausesValidation(false);request.options.onSuccess=this.callbackOnSuccess.bind(this);request.options.onFailure=this.callbackOnFailure.bind(this);request.dispatch();this.requestDispatched=true;return false;}
return this.isValid;},callbackOnSuccess:function(request,data)
-{this.isValid=data;this.requestDispatched=false;Prado.Validation.validate(this.options.FormID,this.group,null);},callbackOnFailure:function(request,data)
-{this.requestDispatched=false;}});Prado.WebUI.TRangeValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function()
+{this.isValid=data;this.requestDispatched=false;Prado.Validation.validate(this.options.FormID,this.group,null);if(typeof(this.options.onSuccess)=="function")
+this.options.onSuccess(request,data);},callbackOnFailure:function(request,data)
+{this.requestDispatched=false;if(typeof(this.options.onFailure)=="function")
+this.options.onFailure(request,data);}});Prado.WebUI.TRangeValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function()
{var value=this.getValidationValue();if(value.length<=0)
return true;if(typeof(this.options.DataType)=="undefined")
this.options.DataType="String";if(this.options.DataType!="StringLength")
diff --git a/framework/Web/Javascripts/js/debug/validator.js b/framework/Web/Javascripts/js/debug/validator.js
index c38ec2e4..af429e68 100644
--- a/framework/Web/Javascripts/js/debug/validator.js
+++ b/framework/Web/Javascripts/js/debug/validator.js
@@ -1144,11 +1144,15 @@ Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
this.isValid = data;
this.requestDispatched = false;
Prado.Validation.validate(this.options.FormID, this.group,null);
+ if(typeof(this.options.onSuccess) == "function")
+ this.options.onSuccess(request,data);
},
callbackOnFailure : function(request, data)
{
this.requestDispatched = false;
+ if(typeof(this.options.onFailure) == "function")
+ this.options.onFailure(request,data);
}
});
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js
index 893fceef..8904921f 100644
--- a/framework/Web/Javascripts/prado/validation3.js
+++ b/framework/Web/Javascripts/prado/validation3.js
@@ -1144,11 +1144,15 @@ Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
this.isValid = data;
this.requestDispatched = false;
Prado.Validation.validate(this.options.FormID, this.group,null);
+ if(typeof(this.options.onSuccess) == "function")
+ this.options.onSuccess(request,data);
},
callbackOnFailure : function(request, data)
{
this.requestDispatched = false;
+ if(typeof(this.options.onFailure) == "function")
+ this.options.onFailure(request,data);
}
});