diff options
author | wei <> | 2006-05-14 00:30:53 +0000 |
---|---|---|
committer | wei <> | 2006-05-14 00:30:53 +0000 |
commit | ae43fa72cdae13bace16a5b8250170e472bb2b87 (patch) | |
tree | 6efea16ae0773f5c739bff2cf643f54ba499e5c0 /framework/Web/Javascripts/prado/ajax3.js | |
parent | ddc3ea15bbfd0235fe90f3b2211bf4cc605e25d6 (diff) |
refactor active controls.
Diffstat (limited to 'framework/Web/Javascripts/prado/ajax3.js')
-rw-r--r-- | framework/Web/Javascripts/prado/ajax3.js | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/framework/Web/Javascripts/prado/ajax3.js b/framework/Web/Javascripts/prado/ajax3.js index b21e9429..1e832889 100644 --- a/framework/Web/Javascripts/prado/ajax3.js +++ b/framework/Web/Javascripts/prado/ajax3.js @@ -87,6 +87,11 @@ Object.extend(Prado.CallbackRequest, * Callback request page state field name,
*/
FIELD_CALLBACK_PAGESTATE : 'PRADO_PAGESTATE',
+
+ FIELD_POSTBACK_TARGET : 'PRADO_POSTBACK_TARGET',
+
+ FIELD_POSTBACK_PARAMETER : 'PRADO_POSTBACK_PARAMETER',
+
/**
* List of form fields that will be collected during callback.
*/
@@ -132,7 +137,17 @@ Object.extend(Prado.CallbackRequest, {
var id = command[method][0];
if($(id) || id.indexOf("[]") > -1)
- method.toFunction().apply(this,command[method].concat(transport));
+ {
+ try
+ {
+ method.toFunction().apply(this,command[method].concat(transport));
+ }
+ catch(e)
+ {
+ if(typeof(Logger) != "undefined")
+ Prado.CallbackRequest.Exception.onException(null,e);
+ }
+ }
else if(typeof(Logger) != "undefined")
{
Logger.error("Error in executing callback response:",
@@ -185,12 +200,11 @@ Object.extend(Prado.CallbackRequest, onException : function(request,e)
{
msg = "";
- for(var v in e)
+ $H(e).each(function(item)
{
- if(typeof(v[e]) != "object" && typeof(v[e]) != "function")
- msg += v+":"+e[v]+"\n";
- }
- Logger.error('Uncaught Callback Client Exception:', e);
+ msg += item.key+": "+item.value+"\n";
+ })
+ Logger.error('Uncaught Callback Client Exception:', msg);
},
/**
@@ -407,6 +421,10 @@ Prado.CallbackRequest.prototype = if(typeof(pageState) != "undefined")
data[callback.FIELD_CALLBACK_PAGESTATE] = pageState;
data[callback.FIELD_CALLBACK_TARGET] = this.id;
+ if(this.options.EventTarget)
+ data[callback.FIELD_POSTBACK_TARGET] = this.options.EventTarget;
+ if(this.options.EventParameter)
+ data[callback.FIELD_POSTBACK_PARAMETER] = this.options.EventParameter;
return $H(data).toQueryString();
}
}
|