summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TPage.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TPage.php')
-rw-r--r--framework/Web/UI/TPage.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 94f1f475..11ebc1dd 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -37,7 +37,7 @@ class TPage extends TTemplateControl
const FIELD_PAGESTATE='PRADO_PAGESTATE';
const FIELD_CALLBACK_TARGET='PRADO_CALLBACK_TARGET';
const FIELD_CALLBACK_PARAMETER='PRADO_CALLBACK_PARAMETER';
-// const FIELD_CALLBACK_ID='PRADO_CALLBACK_ID';
+
/**
* @var array system post fields
*/
@@ -48,7 +48,6 @@ class TPage extends TTemplateControl
'PRADO_PAGESTATE'=>true,
'PRADO_CALLBACK_TARGET'=>true,
'PRADO_CALLBACK_PARAMETER'=>true
- //'PRADO_CALLBACK_ID'=>true
);
/**
* @var TForm form instance
@@ -154,6 +153,11 @@ class TPage extends TTemplateControl
* @var array post data loader IDs.
*/
private $_postDataLoaders=array();
+ /**
+ * @var boolean true if callback request is allowed to update the client-
+ * side contents during callback response.
+ */
+ private $_allowCallbackUpdate=false;
/**
* Constructor.
@@ -278,6 +282,8 @@ class TPage extends TTemplateControl
Prado::trace("Page initRecursive()",'System.Web.UI.TPage');
$this->initRecursive();
+ $this->setAllowCallbackUpdate(true);
+
Prado::trace("Page onInitComplete()",'System.Web.UI.TPage');
$this->onInitComplete(null);
@@ -295,6 +301,7 @@ class TPage extends TTemplateControl
Prado::trace("Page raiseChangedEvents()",'System.Web.UI.TPage');
$this->raiseChangedEvents();
+
$this->getAdapter()->processCallbackEvent($writer);
/*
@@ -324,6 +331,28 @@ class TPage extends TTemplateControl
}
/**
+ * Returns true if callback request is allowed to update the client- side
+ * contents during callback response. Default is true if {@link
+ * getIsCallback IsCallback} is true and onInit stage has been completed.
+ * @return boolean true to allow client-side update.
+ */
+ public function getAllowCallbackUpdate()
+ {
+ return $this->_allowCallbackUpdate;
+ }
+
+ /**
+ * Set to true to allow callback request to update client-side content
+ * during callback response. Default is true if {@link getIsCallback
+ * IsCallback} is true and onInit stage has been completed.
+ * @param boolean true to allow callback to update client-side content.
+ */
+ public function setAllowCallbackUpdate($value)
+ {
+ $this->_allowCallbackUpdate = TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
* Gets the callback client script handler that allows javascript functions
* to be executed during the callback response.
* @return TCallbackClientScript interface to client-side javascript code.