summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDropDownList.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TDropDownList.php')
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php14
1 files changed, 13 insertions, 1 deletions
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;
@@ -95,6 +97,16 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid
}
/**
+ * 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.
* If there is no items, it returns -1.