From 233ad780df391ed4af569929c30a1370d2b440ef Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 10 Jun 2006 14:58:25 +0000 Subject: Merge from 3.0 branch till 1150. Fixed the bug that postback js causes controls not inheritable. --- framework/Web/UI/WebControls/TBulletedList.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'framework/Web/UI/WebControls/TBulletedList.php') diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php index fad77232..dfed0b6e 100644 --- a/framework/Web/UI/WebControls/TBulletedList.php +++ b/framework/Web/UI/WebControls/TBulletedList.php @@ -83,6 +83,16 @@ class TBulletedList extends TListControl implements IPostBackEventHandler return 'ul'; } + /** + * 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.TBulletedList'; + } + /** * Adds attribute name-value pairs to renderer. * This overrides the parent implementation with additional bulleted list specific attributes. @@ -323,7 +333,8 @@ class TBulletedList extends TListControl implements IPostBackEventHandler $this->_currentRenderItemIndex = $index; $writer->addAttribute('id', $this->getClientID().$index); $writer->addAttribute('href', "javascript:;//".$this->getClientID().$index); - $this->renderClientControlScript($writer); + $cs = $this->getPage()->getClientScript(); + $cs->registerPostBackControl('Prado.WebUI.TBulletedList',$this->getPostBackOptions()); } if(($accesskey=$this->getAccessKey())!=='') $writer->addAttribute('accesskey',$accesskey); @@ -331,15 +342,6 @@ class TBulletedList extends TListControl implements IPostBackEventHandler $writer->write(THttpUtility::htmlEncode($item->getText())); $writer->renderEndTag(); } - - /** - * Renders the client-script code. - */ - protected function renderClientControlScript($writer) - { - $cs = $this->getPage()->getClientScript(); - $cs->registerPostBackControl(get_class($this),$this->getPostBackOptions()); - } /** * @return array postback options used for linkbuttons. -- cgit v1.2.3