diff options
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/ActiveControls/TBaseActiveControl.php | 18 | ||||
-rw-r--r-- | framework/Web/UI/ActiveControls/TCallbackClientScript.php | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/framework/Web/UI/ActiveControls/TBaseActiveControl.php index ed2e50db..0c54521d 100644 --- a/framework/Web/UI/ActiveControls/TBaseActiveControl.php +++ b/framework/Web/UI/ActiveControls/TBaseActiveControl.php @@ -302,6 +302,23 @@ class TBaseActiveCallbackControl extends TBaseActiveControl }
/**
+ * @param mixed callback parameter value.
+ */
+ public function setCallbackParameter($value)
+ {
+ $this->setOption('CallbackParameter', $value, '');
+ }
+
+ /**
+ * @return mixed callback parameter value.
+ */
+ public function getCallbackParameter()
+ {
+ return $this->getOption('CallbackParameter', '');
+ }
+
+
+ /**
* @return array list of callback javascript options.
*/
protected function getClientSideOptions()
@@ -311,6 +328,7 @@ class TBaseActiveCallbackControl extends TBaseActiveControl $validate = $this->getCausesValidation();
$options['CausesValidation']= $validate ? '' : false;
$options['ValidationGroup']=$this->getValidationGroup();
+ $options['params'] = $this->getCallbackParameter();
return $options;
}
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index bdbe6b1c..498aa681 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -146,6 +146,17 @@ class TCallbackClientScript extends TApplicationComponent }
/**
+ * Raise the client side event (given by $eventName) on a particular element.
+ * @param TControl|string control element or element id
+ * @param string Event name, e.g. "click"
+ */
+ public function raiseClientEvent($control, $eventName)
+ {
+ $this->callClientFunction('Event.fireEvent',
+ array($control, strtolower($eventName)));
+ }
+
+ /**
* Sets the attribute of a particular control.
* @param TControl|string control element or element id
* @param string attribute name
|