summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2005-12-31 03:44:30 +0000
committerxue <>2005-12-31 03:44:30 +0000
commit16c588209ce9197f13f343c83145446c4d92822a (patch)
tree427c091cbc88a3cd6c2c6984fe29adeb53273b80 /framework
parente050f7f5e259ffc9df018a7021e8ed946b4d614e (diff)
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php19
-rw-r--r--framework/Web/UI/WebControls/TListBox.php2
2 files changed, 5 insertions, 16 deletions
diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php
index 5e243065..9b9b1b92 100644
--- a/framework/Web/UI/WebControls/TDropDownList.php
+++ b/framework/Web/UI/WebControls/TDropDownList.php
@@ -10,31 +10,20 @@ class TDropDownList extends TListControl implements IPostBackDataHandler
public function loadPostData($key,$values)
{
- //TODO: Need to doublecheck!!@!
if(!$this->getEnabled(true))
return false;
- $selections=isset($values[$key])?$values[$key]:null;
$this->ensureDataBound();
- if($selections!==null)
+ $selection=isset($values[$key])?$values[$key]:null;
+ if($selection!==null)
{
- $items=$this->getItems();
- $selection=is_array($selections)?$selections[0]:$selections;
- $index=$items->findIndexByValue($selection,false);
+ $index=$this->getItems()->findIndexByValue($selection,false);
if($this->getSelectedIndex()!==$index)
{
$this->setSelectedIndex($index);
return true;
}
- else
- return false;
}
- else if($this->getSelectedIndex()!==-1)
- {
- $this->clearSelection();
- return true;
- }
- else
- return false;
+ return false;
}
public function raisePostDataChangedEvent()
diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php
index 4aabbbac..7f47a49e 100644
--- a/framework/Web/UI/WebControls/TListBox.php
+++ b/framework/Web/UI/WebControls/TListBox.php
@@ -24,8 +24,8 @@ class TListBox extends TListControl implements IPostBackDataHandler
{
if(!$this->getEnabled(true))
return false;
- $selections=isset($values[$key])?$values[$key]:null;
$this->ensureDataBound();
+ $selections=isset($values[$key])?$values[$key]:null;
if($selections!==null)
{
$items=$this->getItems();