From 36f2ce766bde98c11d57b889fd9e1a7f8dff6010 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 1 Oct 2006 03:09:18 +0000 Subject: Fixed #350 and #148, Add TActiveRatingList, should remove TRatingList from WebControls. --- framework/Web/UI/WebControls/TButton.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TButton.php') diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php index 59df8f7c..0b118495 100644 --- a/framework/Web/UI/WebControls/TButton.php +++ b/framework/Web/UI/WebControls/TButton.php @@ -57,6 +57,22 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr return 'input'; } + /** + * @return boolean whether to render javascript. + */ + public function getEnableClientScript() + { + return $this->getViewState('EnableClientScript',true); + } + + /** + * @param boolean whether to render javascript. + */ + public function setEnableClientScript($value) + { + $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); + } + /** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional button specific attributes. @@ -72,7 +88,7 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr $writer->addAttribute('value',$this->getText()); if($this->getEnabled(true)) { - if($this->needPostBackScript()) + if($this->needPostBackScript() && $this->getEnableClientScript()) $this->renderClientControlScript($writer); } else if($this->getEnabled()) // in this case, parent will not render 'disabled' -- cgit v1.2.3