summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
diff options
context:
space:
mode:
authorchristophe.boulain <>2008-12-03 14:22:03 +0000
committerchristophe.boulain <>2008-12-03 14:22:03 +0000
commit6228873cf9d6471463d2413e7dfd7447f759baf2 (patch)
tree496a0e658330c39d4caa35602ba9f783b6f24f9c /framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
parente8f239fea7351b248302a593a8e5eaa2a88c3e80 (diff)
Merge from trunk
Diffstat (limited to 'framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php')
-rw-r--r--framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
index a1410364..3dee5c59 100644
--- a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
@@ -49,6 +49,10 @@ class TTimeTriggeredCallback extends TCallback
if($interval <= 0)
throw new TConfigurationException('callback_interval_be_positive', $this->getID());
$this->setViewState('Interval', $interval, 1);
+ if ($this->getActiveControl()->canUpdateClientSide()){
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.setInterval', array($this, $interval));
+ }
}
/**
@@ -56,10 +60,8 @@ class TTimeTriggeredCallback extends TCallback
*/
public function startTimer()
{
- $id = $this->getClientID();
- $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
- $cs = $this->getPage()->getClientScript();
- $cs->registerEndScript("{$id}:start", $code);
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.start', array($this));
}
/**
@@ -67,10 +69,8 @@ class TTimeTriggeredCallback extends TCallback
*/
public function stopTimer()
{
- $id = $this->getClientID();
- $code = "Prado.WebUI.TTimeTriggeredCallback.stop('{$id}');";
- $cs = $this->getPage()->getClientScript();
- $cs->registerEndScript("{$id}:stop", $code);
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.stop', array($this));
}
/**
@@ -110,8 +110,12 @@ class TTimeTriggeredCallback extends TCallback
parent::render($writer);
$this->getActiveControl()->registerCallbackClientScript(
$this->getClientClassName(), $this->getTriggerOptions());
- if($this->getStartTimerOnLoad())
- $this->startTimer();
+ if($this->getStartTimerOnLoad()){
+ $id = $this->getClientID();
+ $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
+ $cs = $this->getPage()->getClientScript();
+ $cs->registerEndScript("{$id}:start", $code);
+ }
}
/**