diff options
author | wei <> | 2006-09-15 23:49:56 +0000 |
---|---|---|
committer | wei <> | 2006-09-15 23:49:56 +0000 |
commit | b196ea0e2e9ab9078022e88326edecf1ba5b2f9f (patch) | |
tree | 3d9f37bfa14c363fc91df306b798ddc1b7ef872e /framework/Web/UI/ActiveControls/TActivePageAdapter.php | |
parent | 9f2905f5e2a6d0ab33e4e2d82162183cfd63a042 (diff) |
Defer render() calls in callback event handler to a later stage.
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActivePageAdapter.php')
-rw-r--r-- | framework/Web/UI/ActiveControls/TActivePageAdapter.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 3b386902..2df19053 100644 --- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -58,6 +58,8 @@ class TActivePageAdapter extends TControlAdapter */
private $_callbackClient;
+ private $_controlsToRender=array();
+
/**
* Constructor, trap errors and exception to let the callback response
* handle them.
@@ -84,6 +86,18 @@ class TActivePageAdapter extends TControlAdapter }
/**
+ * Register a control for defered render() call.
+ * @param TControl control for defered rendering
+ * @param THtmlWriter the renderer
+ */
+ public function registerControlToRender($control,$writer)
+ {
+ $id = $control->getUniqueID();
+ if(!isset($this->_controlsToRender[$id]))
+ $this->_controlsToRender[$id] = array($control,$writer);
+ }
+
+ /**
* Trap errors and exceptions to be handled by TCallbackErrorHandler.
*/
protected function trapCallbackErrorsExceptions()
@@ -108,6 +122,10 @@ class TActivePageAdapter extends TControlAdapter */
protected function renderResponse($writer)
{
+ //renders all the defered render() calls.
+ foreach($this->_controlsToRender as $rid => $forRender)
+ $forRender[0]->render($forRender[1]);
+
$response = $this->getResponse();
//send response data in header
|