diff options
author | xue <> | 2006-01-02 20:59:17 +0000 |
---|---|---|
committer | xue <> | 2006-01-02 20:59:17 +0000 |
commit | 4d8ed423f7b4a8eae2898cc5552829595717a581 (patch) | |
tree | 69d23707abe6eedf9eda943fe029004aad39ccc8 /framework/Web/UI/WebControls/TRadioButtonList.php | |
parent | 2df9a40f504933e28ddb9974b97ae4b2bb893f86 (diff) |
TCheckBoxList and TRadioButtonList completed.
Diffstat (limited to 'framework/Web/UI/WebControls/TRadioButtonList.php')
-rw-r--r-- | framework/Web/UI/WebControls/TRadioButtonList.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php index 8d80745e..e434e709 100644 --- a/framework/Web/UI/WebControls/TRadioButtonList.php +++ b/framework/Web/UI/WebControls/TRadioButtonList.php @@ -2,17 +2,35 @@ class TRadioButtonList extends TCheckBoxList
{
- protected function createRepeatedControl()
+ protected function getIsMultiSelect()
{
- return new TRadioButton;
+ return false;
}
- public function loadPostData($key,$values)
+ protected function createRepeatedControl()
{
+ return new TRadioButton;
}
- public function raisePostDataChangedEvent()
+ public function loadPostData($key,$values)
{
+ $value=isset($values[$key])?$values[$key]:'';
+ $oldSelection=$this->getSelectedIndex();
+ $this->ensureDataBound();
+ foreach($this->getItems() as $index=>$item)
+ {
+ if($item->getEnabled() && $item->getValue()===$value)
+ {
+ if($index===$oldSelection)
+ return false;
+ else
+ {
+ $this->setSelectedIndex($index);
+ return true;
+ }
+ }
+ }
+ return false;
}
}
|