diff options
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
|