From 75a0a250cc6735d13b3b782daf0127298b37c2b9 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Thu, 4 May 2006 02:02:43 +0000
Subject: Adding TCallback component.
---
.../ActiveControls/TCallbackClientSideOptions.php | 68 +++++++++++++---------
1 file changed, 40 insertions(+), 28 deletions(-)
(limited to 'framework/Web/UI/ActiveControls/TCallbackClientSideOptions.php')
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientSideOptions.php b/framework/Web/UI/ActiveControls/TCallbackClientSideOptions.php
index dea1b4e1..1e1bd52f 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientSideOptions.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientSideOptions.php
@@ -34,27 +34,35 @@ class TClientSideOptions extends TComponent
}
/**
+ * TCallbackClientSideOptions class.
+ *
* The following client side events are executing in order if the callback
* request and response are send and received successfuly.
*
- * - onUninitialized executed when AJAX request is uninitialized.
- * - onLoading executed when AJAX request is initiated
- * - onLoaded executed when AJAX request begins.
- * - onInteractive executed when AJAX request is in progress.
- * - onCompleteexecuted when AJAX response returns.
+ * - onUninitialized executed when callback request is uninitialized.
+ * - onLoading executed when callback request is initiated
+ * - onLoaded executed when callback request begins.
+ * - onInteractive executed when callback request is in progress.
+ * - onCompleteexecuted when callback response returns.
*
* The OnSuccess and OnFailure events are raised when the
* response is returned. A successful request/response will raise
* OnSuccess event otherwise OnFailure will be raised.
*
- * - onSuccess executed when AJAX request returns and is successful.
- * - onFailure executed when AJAX request returns and fails.
+ * - onSuccess executed when callback request returns and is successful.
+ * - onFailure executed when callback request returns and fails.
+ * - onException raised when callback request fails due to
+ * request/response errors.
*
- * - CausesValidation true to perform before callback request.
- * - ValidationGroup validation grouping name.
*/
class TCallbackClientSideOptions extends TClientSideOptions
{
+ /**
+ * Returns javascript statement enclosed within a javascript function.
+ * @param string javascript statement, if string begins within
+ * "javascript:" the whole string is assumed to be a function.
+ * @return string javascript statement wrapped in a javascript function
+ */
protected function ensureFunction($javascript)
{
if(TJavascript::isFunction($javascript))
@@ -175,34 +183,38 @@ class TCallbackClientSideOptions extends TClientSideOptions
$this->setFunction('onFailure', $javascript);
}
- public function getCausesValidation()
- {
- return $this->getOption('CausesValidation');
- }
-
- public function setCausesValidation($value)
- {
- $this->getOptions()->add('CausesValidation', TPropertyValue::ensureBoolean($value));
- }
-
- public function getValidationGroup()
+ /**
+ * @return string javascript code for client-side onException event
+ */
+ public function getOnException()
{
- return $this->getOption('ValidationGroup');
+ return $this->getOption('onException');
}
- public function setValidationGroup($value)
+ /**
+ * @param string javascript code for client-side onException event.
+ */
+ public function setOnException($javascript)
{
- $this->getOptions()->add('ValidationGroup', $value);
- }
+ $this->setFunction('onException', $javascript);
+ }
- public function getValidationForm()
+ /**
+ * @return boolean true to post the state on callback, default is post the
+ * state on callback.
+ */
+ public function getPostState()
{
- return $this->getOption('Form');
+ return $this->getOption('PostState');
}
- public function setValidationForm($value)
+ /**
+ * @param boolean true to post the state of the form with callback requests.
+ * Default is to post the state.
+ */
+ public function setPostState($value)
{
- $this->getOptions()->add('Form', $value);
+ $this->getOptions()->add('PostState', TPropertyValue::ensureBoolean($value));
}
}
--
cgit v1.2.3