From 0226f8f5f430d34b3cead40c4eb7b458933d16c6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 18 Jan 2006 04:20:26 +0000 Subject: update javascript library and usage in web controls --- framework/Web/UI/WebControls/TCheckBox.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 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 72d15822..385eca06 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -349,12 +349,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $page=$this->getPage(); if($this->getAutoPostBack() && $page->getClientSupportsJavaScript()) - { - $options = $this->getAutoPostBackOptions(); - $scripts = $page->getClientScript(); - $postback = $scripts->getPostBackEventReference($this,'',$options,false); - $scripts->registerClientEvent($this, "click", $postback); - } + $page->getClientScript()->registerPostBackControl($this); if(($accesskey=$this->getAccessKey())!=='') $writer->addAttribute('accesskey',$accesskey); @@ -370,17 +365,12 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl * Sets the post back options for this textbox. * @return TPostBackOptions */ - protected function getAutoPostBackOptions() + public function getPostBackOptions() { - $option=new TPostBackOptions(); - $group = $this->getValidationGroup(); - $hasValidators = $this->getPage()->getValidators($group)->getCount()>0; - if($this->getCausesValidation() && $hasValidators) - { - $option->setPerformValidation(true); - $option->setValidationGroup($group); - } - $option->setAutoPostBack(true); + $options['ValidationGroup'] = $this->getValidationGroup(); + $options['CausesValidation'] = $this->getCausesValidation(); + $options['EventTarget'] = $this->getUniqueID(); + return $options; } } -- cgit v1.2.3