summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActiveLabel.php
diff options
context:
space:
mode:
authorwei <>2006-05-05 08:20:50 +0000
committerwei <>2006-05-05 08:20:50 +0000
commit4d70cc125dcd915cdbc8c4f13964d27ebec96eca (patch)
tree3ebd35be9ed02e97a08196817ee330131cf938b4 /framework/Web/UI/ActiveControls/TActiveLabel.php
parent47d05516b1d1c465217c59732bf8442ab0cfd497 (diff)
Update funky active control example. (see tests/FunctionalTests/features/
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActiveLabel.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLabel.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveLabel.php b/framework/Web/UI/ActiveControls/TActiveLabel.php
index 3216be43..7e5a8084 100644
--- a/framework/Web/UI/ActiveControls/TActiveLabel.php
+++ b/framework/Web/UI/ActiveControls/TActiveLabel.php
@@ -36,6 +36,30 @@ class TActiveLabel extends TLabel
parent::__construct();
$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()
+ {
+ return $this->getViewState('CallbackUpdate', true);
+ }
+
+ /**
+ * @return true if can update changes on the client-side during callback.
+ */
+ protected function canUpdateClientSide()
+ {
+ return $this->getIsInitialized() && $this->getAllowCallbackUpdate();
+ }
/**
* On callback response, the inner HTMl of the label is updated.
@@ -44,7 +68,7 @@ class TActiveLabel extends TLabel
public function setText($value)
{
parent::setText($value);
- if($this->getIsInitialized())
+ if($this->canUpdateClientSide())
{
$this->getPage()->getCallbackClient()->update($this, $value);
}
@@ -59,7 +83,7 @@ class TActiveLabel extends TLabel
public function setForControl($value)
{
parent::setForControl($value);
- if($this->getIsInitialized())
+ if($this->canUpdateClientSide())
{
$id=$this->findControl($value)->getClientID();
$this->getPage()->getCallbackClient()->setAttribute($this, 'for', $id);