From 4d70cc125dcd915cdbc8c4f13964d27ebec96eca Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 5 May 2006 08:20:50 +0000 Subject: Update funky active control example. (see tests/FunctionalTests/features/ --- framework/Web/UI/ActiveControls/TCallback.php | 32 ++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TCallback.php') diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php index 9d2301d8..f42b3143 100644 --- a/framework/Web/UI/ActiveControls/TCallback.php +++ b/framework/Web/UI/ActiveControls/TCallback.php @@ -1,9 +1,29 @@ + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005 PradoSoft + * @license http://www.pradosoft.com/license/ + * @version $Revision: $ $Date: $ + * @package System.Web.UI.ActiveControls */ +/** + * TCallback component class. + * + * The TCallback provides a basic callback handler that can be invoke from the + * client side by running the javascript code obtained from the + * {@link getCallbackReference CallbackReference} property. The event {@link + * onCallback OnCallback} is raise when a callback is requested by the TCallback + * component. + * + * @author Wei Zhuo + * @version $Revision: $ $Date: $ + * @package System.Web.UI.ActiveControls + * @since 3.0 + */ class TCallback extends TControl implements ICallbackEventHandler { /** @@ -138,12 +158,14 @@ class TCallback extends TControl implements ICallbackEventHandler * Returns the javascript statement to invoke a callback request for this * control. Additional options for callback can be set via subproperties of * {@link getClientSide ClientSide} property. E.g. ClientSide.OnSuccess="..." + * @param TControl callback handler control, use current object if null. * @return string javascript statement to invoke a callback. */ - public function getCallbackReference() + public function getCallbackReference($control=null) { $client = $this->getPage()->getClientScript(); - return $client->getCallbackReference($this, $this->getCallbackOptions()); + $object = is_null($control) ? $this : $control; + return $client->getCallbackReference($object, $this->getCallbackOptions()); } } -- cgit v1.2.3