diff options
author | wei <> | 2006-09-02 00:31:09 +0000 |
---|---|---|
committer | wei <> | 2006-09-02 00:31:09 +0000 |
commit | b107cad91733d4a2a80f42cdbaab41a4f7b41c9d (patch) | |
tree | b625b12c5b04aadd02ab1d7e71d532181b156428 /framework/Web/Javascripts/prado/validation3.js | |
parent | 452fdf99810fae93d3e8735cc9be5e9cbd4b0622 (diff) |
Fixed #355
Diffstat (limited to 'framework/Web/Javascripts/prado/validation3.js')
-rw-r--r-- | framework/Web/Javascripts/prado/validation3.js | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index 46db6381..f2b3cbb3 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -557,6 +557,7 @@ Prado.WebUI.TBaseValidator.prototype = group : null,
manager : null,
message : null,
+ requestDispatched : false,
/**
* <code>
@@ -602,22 +603,27 @@ Prado.WebUI.TBaseValidator.prototype = * element. Updating the validator control will set the validator
* <tt>visible</tt> property to true.
*/
- updateControl: function()
+ updateControl: function(focus)
{
+ this.refreshControlAndMessage();
+
+ if(this.options.FocusOnError && !this.isValid )
+ Prado.Element.focus(this.options.FocusElementID);
+
+ this.visible = true;
+ },
+
+ refreshControlAndMessage : function()
+ {
+ this.visible = true;
if(this.message)
{
if(this.options.Display == "Dynamic")
this.isValid ? this.message.hide() : this.message.show();
this.message.style.visibility = this.isValid ? "hidden" : "visible";
}
-
if(this.control)
this.updateControlCssClass(this.control, this.isValid);
-
- if(this.options.FocusOnError && !this.isValid)
- Prado.Element.focus(this.options.FocusElementID);
-
- this.visible = true;
},
/**
@@ -667,7 +673,10 @@ Prado.WebUI.TBaseValidator.prototype = }
if(typeof(this.options.OnValidate) == "function")
- this.options.OnValidate(this, invoker);
+ {
+ if(this.requestDispatched == false)
+ this.options.OnValidate(this, invoker);
+ }
if(this.enabled)
this.isValid = this.evaluateIsValid();
@@ -678,10 +687,11 @@ Prado.WebUI.TBaseValidator.prototype = {
if(typeof(this.options.OnSuccess) == "function")
{
- this.visible = true;
- this.message.style.visibility = "visible";
- this.updateControlCssClass(this.control, this.isValid);
- this.options.OnSuccess(this, invoker);
+ if(this.requestDispatched == false)
+ {
+ this.refreshControlAndMessage();
+ this.options.OnSuccess(this, invoker);
+ }
}
else
this.updateControl();
@@ -690,10 +700,11 @@ Prado.WebUI.TBaseValidator.prototype = {
if(typeof(this.options.OnError) == "function")
{
- this.visible = true;
- this.message.style.visibility = "visible";
- this.updateControlCssClass(this.control, this.isValid);
- this.options.OnError(this, invoker);
+ if(this.requestDispatched == false)
+ {
+ this.refreshControlAndMessage();
+ this.options.OnError(this, invoker)
+ }
}
else
this.updateControl();
@@ -1106,7 +1117,6 @@ Prado.WebUI.TCustomValidator = Class.extend(Prado.WebUI.TBaseValidator, Prado.WebUI.TActiveCustomValidator = Class.extend(Prado.WebUI.TBaseValidator,
{
validatingValue : null,
- requestDispatched : false,
/**
* Calls custom validation function.
|