summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TButton.php
diff options
context:
space:
mode:
authorxue <>2006-01-21 22:20:51 +0000
committerxue <>2006-01-21 22:20:51 +0000
commit64d353d1680539fdf3c2d57150f3e93f9f45d84f (patch)
treea2ecad97bbfede61b653b6bd12825b5a6b987083 /framework/Web/UI/WebControls/TButton.php
parentb952f7700884dab38054025ab3b222f4ecf2b5d9 (diff)
Fixed TImageButton about postbackoptions.
Diffstat (limited to 'framework/Web/UI/WebControls/TButton.php')
-rw-r--r--framework/Web/UI/WebControls/TButton.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index 968a783a..b8956739 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -75,12 +75,14 @@ class TButton extends TWebControl implements IPostBackEventHandler
if($this->getEnabled(true))
{
if($this->canCauseValidation())
+ {
+ $writer->addAttribute('id',$this->getClientID());
$this->getPage()->getClientScript()->registerPostBackControl($this);
+ }
}
else if($this->getEnabled()) // in this case, parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
- $writer->addAttribute('id',$this->getClientID());
parent::addAttributesToRender($writer);
}
@@ -89,9 +91,13 @@ class TButton extends TWebControl implements IPostBackEventHandler
*/
protected function canCauseValidation()
{
- $group = $this->getValidationGroup();
- $hasValidators = $this->getPage()->getValidators($group)->getCount()>0;
- return $this->getCausesValidation() && $hasValidators;
+ if($this->getCausesValidation())
+ {
+ $group=$this->getValidationGroup();
+ return $this->getPage()->getValidators($group)->getCount()>0;
+ }
+ else
+ return false;
}
/**