diff options
author | tof <> | 2008-10-16 09:12:20 +0000 |
---|---|---|
committer | tof <> | 2008-10-16 09:12:20 +0000 |
commit | f13aa5583318d2e70723c6f5b05af01b3e0bc8ed (patch) | |
tree | 2269f1ba7850da6f82dc5aa80e4df9ead4026d10 /framework/Web/UI/ActiveControls | |
parent | 53410c113ce3abe579744f991ed410c4b390ce34 (diff) |
Fixed #925
Diffstat (limited to 'framework/Web/UI/ActiveControls')
-rw-r--r-- | framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php | 24 |
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); + } } /** |