diff options
author | wei <> | 2007-01-03 08:17:41 +0000 |
---|---|---|
committer | wei <> | 2007-01-03 08:17:41 +0000 |
commit | e66a34b2bfca3bb803500c4b9c39bed73d2e4001 (patch) | |
tree | e191731f94280eba47d9f660aa398892471f167a /framework/Web/UI/ActiveControls | |
parent | 258c8daf0fad79945620018a08ee84ca14b1d73e (diff) |
Update active controls to use http response body for application data.
Diffstat (limited to 'framework/Web/UI/ActiveControls')
-rw-r--r-- | framework/Web/UI/ActiveControls/TActivePageAdapter.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 514b6880..8ea196f9 100644 --- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -131,7 +131,8 @@ class TActivePageAdapter extends TControlAdapter {
if(!$this->getApplication()->getRequestCompleted())
$this->getApplication()->onEndRequest();
- $this->getResponse()->appendHeader(self::CALLBACK_REDIRECT.': '.$url);
+ $this->appendContentPart($this->getResponse(), self::CALLBACK_REDIRECT, $url);
+ //$this->getResponse()->appendHeader(self::CALLBACK_REDIRECT.': '.$url);
}
/**
@@ -154,7 +155,9 @@ class TActivePageAdapter extends TControlAdapter if(!is_null($responseData))
{
$data = TJavascript::jsonEncode($responseData);
- $response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data);
+
+ $this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data);
+ //$response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data);
}
}
@@ -164,7 +167,8 @@ class TActivePageAdapter extends TControlAdapter if($handler->getActiveControl()->getClientSide()->getEnablePageStateUpdate())
{
$pagestate = $this->getPage()->getClientState();
- $response->appendHeader(self::CALLBACK_PAGESTATE_HEADER.': '.$pagestate);
+ $this->appendContentPart($response, self::CALLBACK_PAGESTATE_HEADER, $pagestate);
+ //$response->appendHeader(self::CALLBACK_PAGESTATE_HEADER.': '.$pagestate);
}
}
@@ -182,8 +186,18 @@ class TActivePageAdapter extends TControlAdapter //output the actions
$executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute();
$actions = TJavascript::jsonEncode($executeJavascript);
- $response->appendHeader(self::CALLBACK_ACTION_HEADER.': '.$actions);
+ $this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions);
+ //$response->appendHeader(self::CALLBACK_ACTION_HEADER.': '.$actions);
+ }
+ /**
+ * Appends data or javascript code to the body content surrounded with delimiters
+ */
+ private function appendContentPart($response, $delimiter, $data)
+ {
+ $content = $response->createHtmlWriter();
+ $content->getWriter()->setBoundary($delimiter);
+ $content->write($data);
}
/**
|