summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TImageButton.php
diff options
context:
space:
mode:
authorxue <>2005-12-13 15:14:38 +0000
committerxue <>2005-12-13 15:14:38 +0000
commit1ed5d8c3f241116df31b92031ae18a2e6b5b3d4c (patch)
treea1a6b303f83294e17c4c20fb2e2b483a4e3d3d22 /framework/Web/UI/WebControls/TImageButton.php
parent597dcf809dac8ba80bf754dc5e02f8b7ff370c8b (diff)
Moved code for registering postback js from onPreRender to addAttributesToRender. It's too early to register js in onPreRender.
Diffstat (limited to 'framework/Web/UI/WebControls/TImageButton.php')
-rw-r--r--framework/Web/UI/WebControls/TImageButton.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php
index de3d1056..f4d61855 100644
--- a/framework/Web/UI/WebControls/TImageButton.php
+++ b/framework/Web/UI/WebControls/TImageButton.php
@@ -89,7 +89,14 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
$writer->addAttribute('type','image');
if(($uniqueID=$this->getUniqueID())!=='')
$writer->addAttribute('name',$uniqueID);
- if(!$this->getEnabled(true) && $this->getEnabled()) // in this case, parent will not render 'disabled'
+ if($this->getEnabled(true))
+ {
+ $scripts = $this->getPage()->getClientScript();
+ $options = $this->getPostBackOptions();
+ $postback = $scripts->getPostBackEventReference($this, '', $options, false);
+ $scripts->registerClientEvent($this, "click", $postback);
+ }
+ else if($this->getEnabled()) // in this case, parent will not render 'disabled'
$writer->addAttribute('disabled','disabled');
parent::addAttributesToRender($writer);
}