summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActiveButton.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/TActiveButton.php
parent0b792552008e99d3104f4153f7e95f5c17fdaf5c (diff)
Adding TCallbackOptions
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActiveButton.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveButton.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveButton.php b/framework/Web/UI/ActiveControls/TActiveButton.php
index db4fa85d..da5ec5ad 100644
--- a/framework/Web/UI/ActiveControls/TActiveButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveButton.php
@@ -101,7 +101,33 @@ class TActiveButton extends TButton 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','');
}
/**
@@ -117,7 +143,7 @@ class TActiveButton extends TButton implements ICallbackEventHandler
/**
* @return array list of callback options.
*/
- protected function getCallbackOptions()
+ protected function getCallbackClientSideOptions()
{
return array_merge($this->getPostBackOptions(),
$this->getClientSide()->getOptions()->toArray());
@@ -134,7 +160,7 @@ class TActiveButton extends TButton implements ICallbackEventHandler
{
$client = $this->getPage()->getClientScript();
$object = is_null($control) ? $this : $control;
- return $client->getCallbackReference($object, $this->getPostBackOptions());
+ return $client->getCallbackReference($object, $this->getCallbackClientSideOptions());
}
}