You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/05/01 22:35:35 UTC

svn commit: r534233 - /struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp

Author: musachy
Date: Tue May  1 13:35:34 2007
New Revision: 534233

URL: http://svn.apache.org/viewvc?view=rev&rev=534233
Log:
Simplify before/after/error notify topics

Modified:
    struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp

Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp?view=diff&rev=534233&r1=534232&r2=534233
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/remotelink/index.jsp Tue May  1 13:35:34 2007
@@ -14,30 +14,28 @@
 	 dojo.byId(widget.targetsArray[0]).innerHTML = "Done";
    }
 
-   dojo.event.topic.subscribe("/before", function(data, type, e){
+   dojo.event.topic.subscribe("/before", function(event, widget){
       alert('inside a topic event. before request');
-      //data : source element id
-      //type : "before"
-      //e    : request object
+      //event: set event.cancel = true, to cancel request
+      //widget: widget that published the topic
    });
    
-   dojo.event.topic.subscribe("/after", function(data, type, e){
+   dojo.event.topic.subscribe("/after", function(data, request, widget){
       alert('inside a topic event. after request');
-      //data : text returned
-      //type : "load"
-      //e    : undefined
+      //data : text returned from request
+      //request: XMLHttpRequest object
+      //widget: widget that published the topic
    });
    
-   dojo.event.topic.subscribe("/error", function(data, type, e){
+   dojo.event.topic.subscribe("/error", function(error, request, widget){
       alert('inside a topic event. on error');
-      //data : error object
-      //type : "error"
-      //e    : undefined
+      //error : error object (error.message has the error message)
+      //request: XMLHttpRequest object
+      //widget: widget that published the topic
    });
    
    dojo.event.topic.subscribe("/topics", function(data, type, e){
       alert('inside a topic event. type='+type);
-      debugger;
       //data : text returned
       //type : "before", "load", "error"
       //e    : request object