summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TRadioButtonList.php
diff options
context:
space:
mode:
authorxue <>2006-01-02 20:59:17 +0000
committerxue <>2006-01-02 20:59:17 +0000
commit4d8ed423f7b4a8eae2898cc5552829595717a581 (patch)
tree69d23707abe6eedf9eda943fe029004aad39ccc8 /framework/Web/UI/WebControls/TRadioButtonList.php
parent2df9a40f504933e28ddb9974b97ae4b2bb893f86 (diff)
TCheckBoxList and TRadioButtonList completed.
Diffstat (limited to 'framework/Web/UI/WebControls/TRadioButtonList.php')
-rw-r--r--framework/Web/UI/WebControls/TRadioButtonList.php26
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;
}
}