diff options
| -rw-r--r-- | demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page | 4 | ||||
| -rw-r--r-- | framework/Web/UI/WebControls/TDropDownList.php | 19 | ||||
| -rw-r--r-- | framework/Web/UI/WebControls/TListBox.php | 2 | 
3 files changed, 7 insertions, 18 deletions
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page index 9b82a969..3554729b 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.page @@ -43,7 +43,7 @@ List box with customized row number, color and font:  <tr>
  <td class="samplenote">
 -Disabled Dropdown list:
 +Disabled dropdown list:
  </td>
  <td class="sampleaction">
  <com:TDropDownList Enabled="false">
 @@ -57,7 +57,7 @@ Disabled Dropdown list:  <tr>
  <td class="samplenote">
 -Auto postback Dropdown list:
 +Auto postback dropdown list:
  </td>
  <td class="sampleaction">
  <com:TDropDownList AutoPostBack="true" SelectedIndexChanged="selectionChanged">
 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();
  | 
