summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TCallback.php
diff options
context:
space:
mode:
authorwei <>2006-05-13 00:21:16 +0000
committerwei <>2006-05-13 00:21:16 +0000
commitddc3ea15bbfd0235fe90f3b2211bf4cc605e25d6 (patch)
treee9eafa54b795bd1514944a4492554014dee169a8 /framework/Web/UI/ActiveControls/TCallback.php
parent0b792552008e99d3104f4153f7e95f5c17fdaf5c (diff)
Adding TCallbackOptions
Diffstat (limited to 'framework/Web/UI/ActiveControls/TCallback.php')
-rw-r--r--framework/Web/UI/ActiveControls/TCallback.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php
index f42b3143..7bb4ee21 100644
--- a/framework/Web/UI/ActiveControls/TCallback.php
+++ b/framework/Web/UI/ActiveControls/TCallback.php
@@ -97,10 +97,36 @@ class TCallback extends TControl implements ICallbackEventHandler
*/
protected function createClientSideOptions()
{
- return new TCallbackClientSideOptions;
+ if(($id=$this->getCallbackOptions())!=='' && ($control=$this->findControl($id))!==null)
+ {
+ if($control instanceof TCallbackOptions)
+ return clone($control->getClientSide());
+ }
+ return new TCallbackClientSideOptions;
+ }
+
+ /**
+ * Sets the ID of a TCallbackOptions component to duplicate the client-side
+ * options for this control. The {@link getClientSide ClientSide}
+ * subproperties has precendent over the CallbackOptions property.
+ * @param string ID of a TCallbackOptions control from which ClientSide
+ * options are cloned.
+ */
+ public function setCallbackOptions($value)
+ {
+ $this->setViewState('CallbackOptions', $value,'');
}
/**
+ * @return string ID of a TCallbackOptions control from which ClientSide
+ * options are cloned.
+ */
+ public function getCallbackOptions()
+ {
+ return $this->getViewState('CallbackOptions','');
+ }
+
+ /**
* @return boolean whether to perform validation if the callback is
* requested.
*/
@@ -146,7 +172,7 @@ class TCallback extends TControl implements ICallbackEventHandler
/**
* @return array list of callback javascript options.
*/
- protected function getCallbackOptions()
+ protected function getCallbackClientSideOptions()
{
$validate = $this->getCausesValidation();
$options['CausesValidation']= $validate ? '' : false;
@@ -165,7 +191,7 @@ class TCallback extends TControl implements ICallbackEventHandler
{
$client = $this->getPage()->getClientScript();
$object = is_null($control) ? $this : $control;
- return $client->getCallbackReference($object, $this->getCallbackOptions());
+ return $client->getCallbackReference($object, $this->getCallbackClientSideOptions());
}
}