From 1180e6486139a9c9662984367c4f624394e06f35 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 12 Aug 2006 12:54:27 +0000 Subject: Add Triggered Callbacks --- .../Web/UI/ActiveControls/TTriggeredCallback.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 framework/Web/UI/ActiveControls/TTriggeredCallback.php (limited to 'framework/Web/UI/ActiveControls/TTriggeredCallback.php') diff --git a/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTriggeredCallback.php new file mode 100644 index 00000000..076166c9 --- /dev/null +++ b/framework/Web/UI/ActiveControls/TTriggeredCallback.php @@ -0,0 +1,49 @@ +getViewState('ControlID', ''); + } + + /** + * @param string The ID of the server control the trigger is bounded to. + */ + public function setControlID($value) + { + $this->setViewState('ControlID', $value, ''); + } + + /** + * @return string target control client ID or html element ID if + * control is not found in hierarchy. + */ + protected function getTargetControl() + { + $id = $this->getControlID(); + if(($control=$this->findControl($id)) instanceof TControl) + return $control->getClientID(); + if($id==='') + { + throw new TConfigurationException( + 'ttriggeredcallback_invalid_controlid', get_class($this)); + } + return $id; + } + + /** + * @return array list of trigger callback options. + */ + protected function getTriggerOptions() + { + $options['ID'] = $this->getClientID(); + $options['ControlID'] = $this->getTargetControl(); + return $options; + } +} + +?> \ No newline at end of file -- cgit v1.2.3