From 633ae42f1c6f7069ba155ffa1bbc3b42fe189bb4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 4 Feb 2007 03:30:32 +0000 Subject: Added renderer feature to TRepeater. --- framework/Web/UI/WebControls/TCheckBox.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TCheckBox.php') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index fefc9331..78002644 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -40,7 +40,7 @@ * @package System.Web.UI.WebControls * @since 3.0 */ -class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable +class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer { /** * @return string tag name of the button @@ -179,6 +179,32 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $this->setViewState('Checked',TPropertyValue::ensureBoolean($value),false); } + /** + * Returns the value indicating whether the checkbox is checked. + * This method is required by {@link IDataRenderer}. + * It is the same as {@link getChecked()}. + * @return boolean whether the checkbox is checked. + * @see getChecked + * @since 3.1.0 + */ + public function getData() + { + return $this->getChecked(); + } + + /** + * Sets the value indicating whether the checkbox is to be checked or not. + * This method is required by {@link IDataRenderer}. + * It is the same as {@link setChecked()}. + * @param boolean whether the checkbox is to be checked + * @see setChecked + * @since 3.1.0 + */ + public function setData($value) + { + $this->setChecked($value); + } + /** * @return boolean whether clicking on the checkbox will post the page. */ -- cgit v1.2.3