diff options
author | xue <> | 2006-01-12 20:50:34 +0000 |
---|---|---|
committer | xue <> | 2006-01-12 20:50:34 +0000 |
commit | 1503b7c7c90f06d75929fe47fc6ee478d447ae9c (patch) | |
tree | 0cb84d77b283069de14ba1820343714135d4b36a | |
parent | 325784e87947dc4bde4fdcb76dfcee2416aec28d (diff) |
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 1f1d0b1b..e3fc8b2f 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -92,6 +92,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * @var boolean */ private $_isValid=true; + private $_registered=false; public function __construct() { @@ -103,11 +104,14 @@ abstract class TBaseValidator extends TLabel implements IValidator { parent::onInit($param); $this->getPage()->getValidators()->add($this); + $this->_registered=true; } protected function onUnload($param) { - $this->getPage()->getValidators()->remove($this); + if($this->_registered && ($page=$this->getPage())!==null) + $page->getValidators()->remove($this); + $this->_registered=false; parent::onUnload($param); } |