From af68030fcf0c266300feb2c100149ecadef7d364 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 16 Jul 2006 01:50:23 +0000 Subject: Merge from 3.0 branch till 1264. --- framework/Web/UI/TControl.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'framework/Web/UI/TControl.php') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index 34aeb85e..aa8ea2a3 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -452,6 +452,28 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable $this->_flags |= self::IS_DISABLE_THEMING; } + /** + * Returns custom data associated with this control. + * A control may be associated with some custom data for various purposes. + * For example, a button may be associated with a string to identify itself + * in a generic OnClick event handler. + * @return mixed custom data associated with this control. Defaults to null. + */ + public function getCustomData() + { + return $this->getViewState('CustomData',null); + } + + /** + * Associates custom data with this control. + * Note, the custom data must be serializable and unserializable. + * @param mixed custom data + */ + public function setCustomData($value) + { + $this->getViewState('CustomData',$value,null); + } + /** * @return boolean whether the control has child controls */ -- cgit v1.2.3