summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TListBox.php
diff options
context:
space:
mode:
authorxue <>2007-04-09 03:32:50 +0000
committerxue <>2007-04-09 03:32:50 +0000
commit3e1e120dbfbde806bcc0331479d28ce2a0bc2dbf (patch)
tree99124fe4c5c337a55dc22bc22b07b4fdb9a3a609 /framework/Web/UI/WebControls/TListBox.php
parentd43420201b1ed45574886e4a94f3f904bd4ea517 (diff)
Added getDataChanged() to IPostBackDataHandler
Diffstat (limited to 'framework/Web/UI/WebControls/TListBox.php')
-rw-r--r--framework/Web/UI/WebControls/TListBox.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php
index c49e2561..6112915f 100644
--- a/framework/Web/UI/WebControls/TListBox.php
+++ b/framework/Web/UI/WebControls/TListBox.php
@@ -38,6 +38,8 @@ Prado::using('System.Web.UI.WebControls.TListControl');
*/
class TListBox extends TListControl implements IPostBackDataHandler, IValidatable
{
+ private $_dataChanged=false;
+
/**
* Adds attribute name-value pairs to renderer.
* This method overrides the parent implementation with additional list box specific attributes.
@@ -99,7 +101,7 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
if($this->getSelectedIndex()!==$index)
{
$this->setSelectedIndex($index);
- return true;
+ return $this->_dataChanged=true;
}
else
return false;
@@ -127,13 +129,16 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
else
$flag=true;
if($flag)
+ {
$this->setSelectedIndices($list);
+ $this->_dataChanged=true;
+ }
return $flag;
}
else if($this->getSelectedIndex()!==-1)
{
$this->clearSelection();
- return true;
+ return $this->_dataChanged=true;
}
else
return false;
@@ -154,6 +159,16 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
}
/**
+ * 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 boolean whether this control allows multiple selection
*/
protected function getIsMultiSelect()