From 6228873cf9d6471463d2413e7dfd7447f759baf2 Mon Sep 17 00:00:00 2001 From: "christophe.boulain" <> Date: Wed, 3 Dec 2008 14:22:03 +0000 Subject: Merge from trunk --- framework/Web/UI/WebControls/TBaseValidator.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'framework/Web/UI/WebControls/TBaseValidator.php') diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index add771cc..b418885c 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -269,8 +269,11 @@ abstract class TBaseValidator extends TLabel implements IValidator { $class = preg_replace ('/ '.preg_quote($cssClass).'/', '',$control->getCssClass()); if(!$this->getIsValid()) + { $class .= ' '.$cssClass; - $control->setCssClass($class); + $control->setCssClass($class); + } elseif ($control->getIsValid()) + $control->setCssClass($class); } } } @@ -493,7 +496,7 @@ abstract class TBaseValidator extends TLabel implements IValidator $this->setIsValid(true); $this->onValidate(); if($this->getVisible(true) && $this->getEnabled(true)) - { + { // if the target is not a disabled web control if(($target=$this->getValidationTarget())!==null && !($target instanceof TWebControl && !$target->getEnabled(true))) { @@ -504,10 +507,17 @@ abstract class TBaseValidator extends TLabel implements IValidator } else { + $target->setIsValid(false); $this->setIsValid(false); $this->onValidationError(); } } + else + { + $this->evaluateIsValid(); + $this->setIsValid(true); + $this->onValidationSuccess(); + } } return $this->getIsValid(); } @@ -721,4 +731,3 @@ class TValidationDataType extends TEnumerable const String='String'; } -?> -- cgit v1.2.3