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/TCheckBoxList.php | 43 ++++++++++++++++++++------ 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'framework/Web/UI/WebControls/TCheckBoxList.php') diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index 89357b55..09b771eb 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -105,16 +105,6 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont return new TTableStyle; } - /** - * Gets the name of the javascript class responsible for performing postback for this control. - * This method overrides the parent implementation. - * @return string the javascript class name - */ - protected function getClientClassName() - { - return 'Prado.WebUI.TCheckBoxList'; - } - /** * @return TTextAlign the alignment of the text caption, defaults to TTextAlign::Right. */ @@ -296,6 +286,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $repeatedControl->setChecked($item->getSelected()); $repeatedControl->setAttribute('value',$item->getValue()); $repeatedControl->setEnabled($this->_isEnabled && $item->getEnabled()); + $repeatedControl->setEnableClientScript(false); $repeatedControl->renderControl($writer); } @@ -389,6 +380,14 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $this->setAccessKey($accessKey); $this->setTabIndex($tabIndex); } + //checkbox skipped the client control script in addAttributesToRender + if($this->getEnabled(true) + && $this->getEnableClientScript() + && $this->getAutoPostBack() + && $this->getPage()->getClientSupportsJavaScript()) + { + $this->renderClientControlScript($writer); + } } /** @@ -400,6 +399,30 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont { return $this->getSelectedValue(); } + + /** + * Gets the name of the javascript class responsible for performing postback for this control. + * This method overrides the parent implementation. + * @return string the javascript class name + */ + protected function getClientClassName() + { + return 'Prado.WebUI.TCheckBoxList'; + } + + /** + * Gets the post back options for this checkbox. + * @return array + */ + protected function getPostBackOptions() + { + $options['ListID'] = $this->getClientID(); + $options['ValidationGroup'] = $this->getValidationGroup(); + $options['CausesValidation'] = $this->getCausesValidation(); + $options['ListName'] = $this->getUniqueID(); + $options['ItemCount'] = $this->getItemCount(); + return $options; + } } ?> \ No newline at end of file -- cgit v1.2.3