From ae43fa72cdae13bace16a5b8250170e472bb2b87 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 14 May 2006 00:30:53 +0000 Subject: refactor active controls. --- framework/Web/UI/ActiveControls/TActiveLabel.php | 31 ++++-------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TActiveLabel.php') diff --git a/framework/Web/UI/ActiveControls/TActiveLabel.php b/framework/Web/UI/ActiveControls/TActiveLabel.php index 13a88b4f..fd2d49b8 100644 --- a/framework/Web/UI/ActiveControls/TActiveLabel.php +++ b/framework/Web/UI/ActiveControls/TActiveLabel.php @@ -37,32 +37,11 @@ class TActiveLabel extends TLabel $this->setAdapter(new TActiveControlAdapter($this)); } - /** - * @param boolean true to allow fine grain callback updates. - */ - public function setAllowCallbackUpdate($value) - { - $this->setViewState('CallbackUpdate', TPropertyValue::ensureBoolean($value), true); - } - - /** - * @return true to allow fine grain callback updates. - */ - public function getAllowCallbackUpdate() + public function getActiveControl() { - return $this->getViewState('CallbackUpdate', true); + return $this->getAdapter()->getActiveControl(); } - - /** - * @return true if can update changes on the client-side during callback. - */ - protected function canUpdateClientSide() - { - return $this->getIsInitialized() - && $this->getPage()->getIsCallback() - && $this->getAllowCallbackUpdate(); - } - + /** * On callback response, the inner HTMl of the label is updated. * @param string the text value of the label @@ -70,7 +49,7 @@ class TActiveLabel extends TLabel public function setText($value) { parent::setText($value); - if($this->canUpdateClientSide()) + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); } @@ -83,7 +62,7 @@ class TActiveLabel extends TLabel public function setForControl($value) { parent::setForControl($value); - if($this->canUpdateClientSide()) + if($this->getActiveControl()->canUpdateClientSide()) { $id=$this->findControl($value)->getClientID(); $this->getPage()->getCallbackClient()->setAttribute($this, 'for', $id); -- cgit v1.2.3