You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/09/16 10:27:50 UTC
svn commit: r815662 -
/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Author: weber
Date: Wed Sep 16 08:27:47 2009
New Revision: 815662
URL: http://svn.apache.org/viewvc?rev=815662&view=rev
Log:
(TOBAGO-796) tobago blocks on error in onComplete javascript
<https://issues.apache.org/jira/browse/TOBAGO-796>
Modified:
myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=815662&r1=815661&r2=815662&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Sep 16 08:27:47 2009
@@ -1763,6 +1763,10 @@
setDefaultAction: function(defaultActionId) {
Tobago.action.value = defaultActionId;
+ },
+
+ isFunction: function (func) {
+ return (typeof func == "function");
}
};
@@ -2161,10 +2165,11 @@
}
if (this.responseIsSuccess()) {
- if (this.onComplete)
+ if (Tobago.isFunction(this.onComplete)) {
setTimeout(this.onComplete.bind(this), 10);
+ }
}
-}
+};
Tobago.Updater = {
@@ -2220,7 +2225,7 @@
if (this.hasTransport()) {
- if (Tobago.applicationOnsubmit) {
+ if (Tobago.isFunction(Tobago.applicationOnsubmit)) {
var result = Tobago.applicationOnsubmit();
if (!result) {
return;
@@ -2232,12 +2237,12 @@
Tobago.extend(requestOptions, options);
}
- if (requestOptions.createOverlay) {
+ if (Tobago.isFunction(requestOptions.createOverlay)) {
Tobago.createOverlay(container);
if (requestOptions.onFailure === undefined) {
requestOptions.onFailure = function(transport, json) {
Tobago.deleteOverlay(container);
- }
+ };
}
}
@@ -2245,7 +2250,15 @@
var onComplete = requestOptions.onComplete;
requestOptions.onComplete = function(transport, json) {
- onComplete(transport, json);
+ if (Tobago.isFunction(onComplete)) {
+ try {
+ onComplete(transport, json);
+ } catch(e) {
+ LOG.show();
+ LOG.warn(e);
+ LOG.error("error in ajax.onComplete! Code was " + onComplete.toString());
+ }
+ }
// scripts included in response are executed via setTimeout(..., 10)
// because of replaceJsfState() is in this scripts the next request
// must be delayed more than that.