summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-10-24 23:45:36 +0200
committerFabio Bas <ctrlaltca@gmail.com>2013-10-24 23:45:36 +0200
commita0ba7a2196cf4379c1772d36aeaf899b2cf47752 (patch)
treeb02f1b8e30f0a79a4479b20b2f6a74fa0c2ccfca /framework/Web/UI
parent695087b624283799fa9a150fceab0eff97bf9c68 (diff)
More work on ajax
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveControlAdapter.php20
-rw-r--r--framework/Web/UI/ActiveControls/TActiveImageButton.php12
-rw-r--r--framework/Web/UI/ActiveControls/TActiveListBox.php6
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientScript.php5
-rw-r--r--framework/Web/UI/TControl.php10
-rw-r--r--framework/Web/UI/TPage.php26
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php8
-rw-r--r--framework/Web/UI/WebControls/TRadioButton.php10
8 files changed, 0 insertions, 97 deletions
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);
@@ -99,25 +98,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
*/
public function setBaseActiveControl($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
@@ -135,18 +135,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
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 5ee20d61..cbc6a409 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -1330,21 +1330,11 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
$control->evaluateDynamicContent();
}
}
- $this->addToPostDataLoader();
}
$this->_stage=self::CS_PRERENDERED;
}
/**
- * Add controls implementing IPostBackDataHandler to post data loaders.
- */
- protected function addToPostDataLoader()
- {
- if($this instanceof IPostBackDataHandler)
- $this->getPage()->registerPostDataLoader($this);
- }
-
- /**
* Performs the Unload step for the control and all its child controls.
* Only framework developers should use this method.
*/
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 39656e13..4e8652f4 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -155,10 +155,6 @@ class TPage extends TTemplateControl
*/
private $_clientState='';
/**
- * @var array post data loader IDs.
- */
- protected $_postDataLoaders=array();
- /**
* @var boolean true if loading post data.
*/
protected $_isLoadingPostData=false;
@@ -427,27 +423,6 @@ class TPage extends TTemplateControl
}
/**
- * Register post data loaders for Callback to collect post data.
- * This method should only be called by framework developers.
- * @param TControl control that requires post data.
- * @see TControl::preRenderRecursive();
- */
- public function registerPostDataLoader($control)
- {
- $id=is_string($control)?$control:$control->getUniqueID();
- $this->_postDataLoaders[$id] = true;
- }
-
- /**
- * Get a list of IDs of controls that are enabled and require post data.
- * @return array list of IDs implementing IPostBackDataHandler
- */
- public function getPostDataLoaders()
- {
- return array_keys($this->_postDataLoaders);
- }
-
- /**
* @return TForm the form on the page
*/
public function getForm()
@@ -825,7 +800,6 @@ class TPage extends TTemplateControl
{
$id=is_string($control)?$control:$control->getUniqueID();
$this->_controlsRegisteredForPostData[$id]=true;
- $this->registerPostDataLoader($id);
$params=func_get_args();
foreach($this->getCachingStack() as $item)
$item->registerAction('Page','registerRequiresPostData',array($id));
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index a67997b8..b5ed8a86 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -406,14 +406,6 @@ class TDatePicker extends TTextBox
public function onPreRender($param)
{
parent::onPreRender($param);
- if($this->getInputMode() === TDatePickerInputMode::DropDownList)
- {
- $page = $this->getPage();
- $uniqueID = $this->getUniqueID();
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'day');
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'month');
- $page->registerPostDataLoader($uniqueID.TControl::ID_SEPARATOR.'year');
- }
$this->publishCalendarStyle();
$this->registerCalendarClientScriptPre();
}
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php
index 144704b4..dbb0dac0 100644
--- a/framework/Web/UI/WebControls/TRadioButton.php
+++ b/framework/Web/UI/WebControls/TRadioButton.php
@@ -156,16 +156,6 @@ class TRadioButton extends TCheckBox
}
/**
- * Add the group name as post data loader if group name is set.
- */
- protected function addToPostDataLoader()
- {
- parent::addToPostDataLoader();
- $group = $this->getGroupName();
- if(!empty($group) || $this->getViewState('UniqueGroupName','') !== '')
- $this->getPage()->registerPostDataLoader($this->getUniqueGroupName());
- }
- /**
* @return string the name used to fetch radiobutton post data
*/
public function getUniqueGroupName()