From a494b2151b0d9f11f0f16fd4ed8b5340d6735324 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 16 Jul 2006 01:46:08 +0000 Subject: Fixed #277. --- 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 583b5f77..ff4a85ea 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -451,6 +451,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