summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2006-01-12 20:50:34 +0000
committerxue <>2006-01-12 20:50:34 +0000
commit1503b7c7c90f06d75929fe47fc6ee478d447ae9c (patch)
tree0cb84d77b283069de14ba1820343714135d4b36a /framework/Web
parent325784e87947dc4bde4fdcb76dfcee2416aec28d (diff)
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php6
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);
}