From d255f4d0e332740b3984e21ce3f7a4a4f1968ba3 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 2 May 2006 08:28:17 +0000 Subject: Adding more work on ActiveControls. --- framework/Web/UI/TClientScriptManager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'framework/Web/UI/TClientScriptManager.php') diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 94ef19b6..46203b0b 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -164,6 +164,21 @@ class TClientScriptManager extends TApplicationComponent } } + public function getCallbackReference($callbackHandler, $options=null) + { + $options = !is_array($options) ? array() : $options; + $class = new TReflectionClass($callbackHandler); + if($class->hasMethod('getClientSide')) + { + $clientSide = $callbackHandler->getClientSide(); + $options = array_merge($options, $clientSide->getOptions()->toArray()); + } + $optionString = TJavascript::encode($options); + $this->registerPradoScriptInternal('ajax'); + $id = $callbackHandler->getUniqueID(); + return "new Prado.CallbackRequest('{$id}',{$optionString})"; + } + /** * Registers postback javascript for a control. * @param string javascript class responsible for the control being registered for postback -- cgit v1.2.3