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/TDropDownList.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TDropDownList.php') diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php index 5bcf0f35..90668b95 100644 --- a/framework/Web/UI/WebControls/TDropDownList.php +++ b/framework/Web/UI/WebControls/TDropDownList.php @@ -35,6 +35,8 @@ Prado::using('System.Web.UI.WebControls.TListControl'); */ class TDropDownList extends TListControl implements IPostBackDataHandler, IValidatable { + private $_dataChanged=false; + /** * Adds attributes to renderer. * @param THtmlWriter the renderer @@ -74,7 +76,7 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid if($this->getSelectedIndex()!==$index) { $this->setSelectedIndex($index); - return true; + return $this->_dataChanged=true; } } return false; @@ -94,6 +96,16 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid $this->onSelectedIndexChanged(null); } + /** + * 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; + } + /** * @return integer the index (zero-based) of the item being selected. * If none is selected, the return value is 0 meaning the first item is selected. -- cgit v1.2.3