From a0ba7a2196cf4379c1772d36aeaf899b2cf47752 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 24 Oct 2013 23:45:36 +0200 Subject: More work on ajax --- .../Web/UI/ActiveControls/TActiveControlAdapter.php | 20 -------------------- .../Web/UI/ActiveControls/TActiveImageButton.php | 12 ------------ framework/Web/UI/ActiveControls/TActiveListBox.php | 6 ------ .../Web/UI/ActiveControls/TCallbackClientScript.php | 5 ----- 4 files changed, 43 deletions(-) (limited to 'framework/Web/UI/ActiveControls') diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php index ab15f091..6c209ac5 100644 --- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php +++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php @@ -89,7 +89,6 @@ class TActiveControlAdapter extends TControlAdapter public function render($writer) { $this->getPage()->getClientScript()->registerPradoScript('ajax'); - $this->renderCallbackClientScripts(); if($this->_control->getVisible(false)) { parent::render($writer); @@ -98,25 +97,6 @@ class TActiveControlAdapter extends TControlAdapter } } - /** - * Register the callback clientscripts and sets the post loader IDs. - */ - protected function renderCallbackClientScripts() - { - $cs = $this->getPage()->getClientScript(); - $key = 'Prado.CallbackRequest.addPostLoaders'; - if(!$cs->isEndScriptRegistered($key)) - { - $data = $this->getPage()->getPostDataLoaders(); - if(count($data) > 0) - { - $options = TJavaScript::encode($data,false); - $script = "Prado.CallbackRequest.addPostLoaders({$options});"; - $cs->registerEndScript($key, $script); - } - } - } - /** * @param TBaseActiveControl change base active control */ diff --git a/framework/Web/UI/ActiveControls/TActiveImageButton.php b/framework/Web/UI/ActiveControls/TActiveImageButton.php index b2aa9960..8fe5e33d 100644 --- a/framework/Web/UI/ActiveControls/TActiveImageButton.php +++ b/framework/Web/UI/ActiveControls/TActiveImageButton.php @@ -134,18 +134,6 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba { } - /** - * Register the x and y hidden input names of the position clicked. - * @param THtmlWriter the renderer. - */ - public function onPreRender($writer) - { - parent::onPreRender($writer); - $uid = $uid=$this->getUniqueID(); - $this->getPage()->registerPostDataLoader($uid.'_x'); - $this->getPage()->registerPostDataLoader($uid.'_y'); - } - /** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php index dfb4bf6e..913cdeda 100644 --- a/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -95,8 +95,6 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH $client = $this->getPage()->getCallbackClient(); $client->setAttribute($this, 'multiple', $multiple ? 'multiple' : false); $client->setAttribute($this, 'name', $multiple ? $multi_id : $id); - if($multiple) - $client->addPostDataLoader($multi_id); } } @@ -130,10 +128,6 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH { parent::onPreRender($param); $this->getAdapter()->updateListItems(); - $multiple = $this->getIsMultiSelect(); - $id = $this->getUniqueID(); $multi_id = $id.'[]'; - if($multiple) - $this->getPage()->registerPostDataLoader($multi_id); } /** diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 15300727..a25e7f41 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -304,11 +304,6 @@ class TCallbackClientScript extends TApplicationComponent $this->jQuery($element, 'remove'); } - public function addPostDataLoader($name) - { - $this->callClientFunction('Prado.CallbackRequest.addPostLoaders', $name); - } - /** * Update the element's innerHTML with new content. * @param TControl control element or element id -- cgit v1.2.3