cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jer...@apache.org
Subject svn commit: r477678 - in /cocoon/trunk/blocks: cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/ cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/ cocoon-forms/cocoon-forms-impl/src/main/r...
Date Tue, 21 Nov 2006 14:08:26 GMT
Author: jeremy
Date: Tue Nov 21 06:08:25 2006
New Revision: 477678

URL: http://svn.apache.org/viewvc?view=rev&rev=477678
Log:
Fixed the issue whereby the BrowserUpdate response from Cocoon could not be viewed, when there
is an error.

Modified:
    cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
    cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/CFormsForm.js

Modified: cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js?view=diff&rev=477678&r1=477677&r2=477678
==============================================================================
--- cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
(original)
+++ cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/js/BUHandler.js
Tue Nov 21 06:08:25 2006
@@ -53,7 +53,7 @@
 				nodes = base.childNodes;
 				dojo.debug("got response using: IframeTransport");
 			} else {
-				this.handleError("No response data found", request);
+				this.handleError("No response data found", doc);
 			}
 		}
 		for (var i = 0; i < nodes.length; i++) {
@@ -65,22 +65,26 @@
 				if (handlerFunc) {
 					handlerFunc(node);
 				} else {
-					this.handleError("No handler found for element " + handler, request);
+					this.handleError("No handler found for element " + handler, doc);
 				}
 			}
 		}
 	},
 	
-	handleError: function(message, request) {
+	handleError: function(message, response) {
 		if (confirm(message + "\nShow server response?")) {
 			var w = window.open(undefined, "Cocoon Error", "location=no,resizable=yes,scrollbars=yes");
 			if (w == undefined) {
 				alert("You must allow popups from this server to display the response.");
 			} else {
 				var doc = w.document;
-				doc.open();
-				doc.write(request.responseText);
-				doc.close();
+				if (response.responseText) {
+					doc.open();
+					doc.write(response.responseText);
+					doc.close();
+				} else if (response.childNodes) {
+					dojo.dom.copyChildren(doc,response);
+				}
 			}
 		}
 	},

Modified: cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js?view=diff&rev=477678&r1=477677&r2=477678
==============================================================================
--- cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js
(original)
+++ cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/system/System.Upload.js
Tue Nov 21 06:08:25 2006
@@ -94,7 +94,7 @@
             json = success;
         }
     }
-    cocoon.sendPage("send-json", {json: status});
+    cocoon.sendPage("send-json", {json: json});
 };
 
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/CFormsForm.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/CFormsForm.js?view=diff&rev=477678&r1=477677&r2=477678
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/CFormsForm.js
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/CFormsForm.js
Tue Nov 21 06:08:25 2006
@@ -130,13 +130,13 @@
         if (type == "load") {
             // Handle browser update directives
             if (!data) {
-                cocoon.ajax.BUHandler.handleError("No xml answer", evt);
+                cocoon.ajax.BUHandler.handleError("No xml answer", data);
                 return;
             }
             updater.handlers['continue'] = function() { widget._continue(); }
             updater.processResponse(data, evt);
         } else if (type == "error") {
-            updater.handleError("Request failed", evt);
+            updater.handleError("Request failed", data);
         } else {
             // umm, how did we get here ?
         }



Mime
View raw message