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/TCheckBox.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/WebControls/TCheckBox.php') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index 2b9fd6b7..fefc9331 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -336,6 +336,22 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } } + /** + * @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); + } + /** * Renders a label beside the checkbox. * @param THtmlWriter the writer for the rendering purpose @@ -375,8 +391,13 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $writer->addAttribute('disabled','disabled'); $page=$this->getPage(); - if($this->getEnabled(true) && $this->getAutoPostBack() && $page->getClientSupportsJavaScript()) + if($this->getEnabled(true) + && $this->getEnableClientScript() + && $this->getAutoPostBack() + && $page->getClientSupportsJavaScript()) + { $this->renderClientControlScript($writer); + } if(($accesskey=$this->getAccessKey())!=='') $writer->addAttribute('accesskey',$accesskey); @@ -419,7 +440,6 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $options['EventTarget'] = $this->getUniqueID(); return $options; } - } /** -- cgit v1.2.3