diff options
author | xue <> | 2006-04-22 12:53:22 +0000 |
---|---|---|
committer | xue <> | 2006-04-22 12:53:22 +0000 |
commit | 72a75d7d0f5681df3fd98c684ab6f22baefb365c (patch) | |
tree | 40cc63eb41f47e0ac392c692619640dca57cd262 /framework/Web/UI/WebControls | |
parent | 3ad074e9410153fefaa2343165a68a355400fd6e (diff) |
Merge from 3.0 branch till 956.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TCheckBox.php | 10 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TRadioButton.php | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index c3e5e640..ff7f57f7 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -307,12 +307,11 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl {
$attributes=$this->getViewState('InputAttributes',null);
if($attributes && $attributes->contains('value'))
- $value=$attributes->itemAt('value');
+ return $attributes->itemAt('value');
else if($this->hasAttribute('value'))
- $value=$this->getAttribute('value');
+ return $this->getAttribute('value');
else
- $value='';
- return $value===''?$this->getUniqueID():$value;
+ return '';
}
/**
@@ -341,7 +340,8 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl if($clientID!=='')
$writer->addAttribute('id',$clientID);
$writer->addAttribute('type','checkbox');
- $writer->addAttribute('value',$this->getValueAttribute());
+ if(($value=$this->getValueAttribute())!=='')
+ $writer->addAttribute('value',$value);
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
if($this->getChecked())
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php index dc5320b6..9a523b55 100644 --- a/framework/Web/UI/WebControls/TRadioButton.php +++ b/framework/Web/UI/WebControls/TRadioButton.php @@ -101,6 +101,14 @@ class TRadioButton extends TCheckBox $this->setViewState('GroupName',$value,'');
}
+ protected function getValueAttribute()
+ {
+ if(($value=parent::getValueAttribute())==='')
+ return $this->getUniqueID();
+ else
+ return $value;
+ }
+
/**
* @return string the name used to fetch radiobutton post data
*/
|