예제 #1
0
 protected function processCallbackRequest($writer)
 {
     Prado::using('System.Web.UI.ActiveControls.TActivePageAdapter');
     $this->setAdapter(new TActivePageAdapter($this));
     $callbackEventParameter = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
     if (strlen($callbackEventParameter) > 0) {
         $this->_postData[TPage::FIELD_CALLBACK_PARAMETER] = TJavaScript::jsonDecode((string) $callbackEventParameter);
     }
     if (($g = $this->getApplication()->getGlobalization(false)) !== null && strtoupper($enc = $g->getCharset()) != 'UTF-8') {
         foreach ($this->_postData as $k => $v) {
             $this->_postData[$k] = self::decodeUTF8($v, $enc);
         }
     }
     $this->onPreInit(null);
     $this->initRecursive();
     $this->onInitComplete(null);
     $this->_restPostData = new TMap();
     $this->loadPageState();
     $this->processPostData($this->_postData, true);
     $this->onPreLoad(null);
     $this->loadRecursive();
     $this->processPostData($this->_restPostData, false);
     $this->raiseChangedEvents();
     $this->getAdapter()->processCallbackEvent($writer);
     $this->onLoadComplete(null);
     $this->preRenderRecursive();
     $this->onPreRenderComplete(null);
     $this->savePageState();
     $this->onSaveStateComplete(null);
     $this->getAdapter()->renderCallbackResponse($writer);
     $this->unloadRecursive();
 }
예제 #2
0
 /**
  * Gets callback parameter. JSON encoding is assumed.
  * @return string postback event parameter
  */
 public function getCallbackEventParameter()
 {
     if ($this->_callbackEventParameter === null) {
         $param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
         if (strlen($param) > 0) {
             $this->_callbackEventParameter = TJavaScript::jsonDecode((string) $param);
         }
     }
     return $this->_callbackEventParameter;
 }