diff options
author | christophe.boulain <> | 2008-12-03 14:22:03 +0000 |
---|---|---|
committer | christophe.boulain <> | 2008-12-03 14:22:03 +0000 |
commit | 6228873cf9d6471463d2413e7dfd7447f759baf2 (patch) | |
tree | 496a0e658330c39d4caa35602ba9f783b6f24f9c /framework/Web/UI/WebControls/TBaseValidator.php | |
parent | e8f239fea7351b248302a593a8e5eaa2a88c3e80 (diff) |
Merge from trunk
Diffstat (limited to 'framework/Web/UI/WebControls/TBaseValidator.php')
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 15 |
1 files changed, 12 insertions, 3 deletions
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'; } -?> |