From 3e1e120dbfbde806bcc0331479d28ce2a0bc2dbf Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 9 Apr 2007 03:32:50 +0000 Subject: Added getDataChanged() to IPostBackDataHandler --- framework/Web/UI/WebControls/TCheckBox.php | 14 +++++++++++++- 1 file changed, 13 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 bf2f9d05..7a0fc603 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -42,6 +42,8 @@ */ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer { + private $_dataChanged=false; + /** * @return string tag name of the button */ @@ -63,7 +65,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl if($newChecked=isset($values[$key])) $this->setValue($values[$key]); $this->setChecked($newChecked); - return $newChecked!==$checked; + return $this->_dataChanged=($newChecked!==$checked); } /** @@ -104,6 +106,16 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $this->getPage()->registerRequiresPostData($this); } + /** + * Returns a value indicating whether postback has caused the control data change. + * This method is required by the IPostBackDataHandler interface. + * @return boolean whether postback has caused the control data change. False if the page is not in postback mode. + */ + public function getDataChanged() + { + return $this->_dataChanged; + } + /** * Returns the value of the property that needs validation. * @return mixed the property value to be validated -- cgit v1.2.3