summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TCallback.php
diff options
context:
space:
mode:
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());
}
}