From e3a43f088e9e7ce3381168d7c8b9ad0592903148 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 13 Mar 2008 15:39:19 +0000 Subject: Fixed #769 --- .../source/prado/validator/validation3.js | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js index ffdbe7b0..45e9aa43 100644 --- a/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -186,14 +186,25 @@ Prado.ValidationManager.prototype = */ initialize : function(options) { - this.validators = []; // list of validators - this.summaries = []; // validation summaries - this.groups = []; // validation groups - this.options = {}; - - this.options = options; if(!Prado.Validation.managers[options.FormID]) + { + this.validators = []; // list of validators + this.summaries = []; // validation summaries + this.groups = []; // validation groups + this.options = {}; + + this.options = options; + Prado.Validation.managers[options.FormID] = this; + } + else + { + var manager = Prado.Validation.managers[options.FormID]; + this.validators = manager.validators; + this.summaries = manager.summaries; + this.groups = manager.groups; + this.options = manager.options; + } }, /** @@ -286,6 +297,11 @@ Prado.ValidationManager.prototype = */ addValidator : function(validator) { + // Erase any existing validator with same options + this.validators = this.validators.reject(function(v) + { + return (v.options.ID==validator.options.ID); + }); this.validators.push(validator); if(validator.group && !this.groups.include(validator.group)) this.groups.push(validator.group); -- cgit v1.2.3