You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by GitBox <gi...@apache.org> on 2020/02/26 11:52:43 UTC

[GitHub] [wicket] reiern70 opened a new pull request #410: [WICKET-6750] allow to abort currently executing request for a given …

reiern70 opened a new pull request #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410
 
 
   allow to abort currently executing request for a given Ajax channel + example

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] reiern70 closed pull request #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
reiern70 closed pull request #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] svenmeier commented on issue #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
svenmeier commented on issue #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#issuecomment-593276223
 
 
   How about extracting that code into a behavior, e.g. something which can be added to a button?
   This would be much nicer to use (showing/hiding the button, keeping track of the currrent Ajax request, cancelling it).
   With its own JS file it we could keep this stuff out of the core JS, maybe add this feature to wicket-extensions.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#discussion_r384522325
 
 

 ##########
 File path: wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 ##########
 @@ -335,6 +335,58 @@
 
 	Wicket.ChannelManager.FunctionsExecuter = FunctionsExecuter;
 
+	/**
+	 * Channel manager maintains a map of channels.
 
 Review comment:
   TODO: Change this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#discussion_r384522677
 
 

 ##########
 File path: wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 ##########
 @@ -335,6 +335,58 @@
 
 	Wicket.ChannelManager.FunctionsExecuter = FunctionsExecuter;
 
+	/**
+	 * Channel manager maintains a map of channels.
+	 */
+	Wicket.AjaxRequestMonitor = Wicket.Class.create();
+
+	Wicket.AjaxRequestMonitor.prototype = {
+		initialize: function () {
+			this.requests = [];
+		},
+
+		init: function() {
+			var requests = this.requests;
+			Wicket.Event.subscribe('/ajax/call/beforeSend',
+				function(jqEvent, attributes, jqXHR, errorThrown, textStatus) {
+					requests [attributes.ch] = jqXHR;
+				}
+			);
+
+			Wicket.Event.subscribe('/ajax/call/complete',
+				function(jqEvent, attributes, jqXHR, errorThrown, textStatus) {
+					delete requests[attributes.ch];
+				}
+			);
+		},
+
+		getReuest: function (channel) {
 
 Review comment:
   and this

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] svenmeier edited a comment on issue #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
svenmeier edited a comment on issue #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#issuecomment-593276223
 
 
   How about extracting that code into a behavior, e.g. something which can be added to a button?
   This would be much nicer to use (showing/hiding the button, keeping track of the currrent Ajax request, cancelling it).
   With its own JS file we could keep this stuff out of the core JS, maybe add this feature to wicket-extensions.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
reiern70 commented on a change in pull request #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#discussion_r384522325
 
 

 ##########
 File path: wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
 ##########
 @@ -335,6 +335,58 @@
 
 	Wicket.ChannelManager.FunctionsExecuter = FunctionsExecuter;
 
+	/**
+	 * Channel manager maintains a map of channels.
 
 Review comment:
   Change this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [wicket] reiern70 commented on issue #410: [WICKET-6750] allow to abort currently executing request for a given …

Posted by GitBox <gi...@apache.org>.
reiern70 commented on issue #410: [WICKET-6750] allow to abort currently executing request for a given …
URL: https://github.com/apache/wicket/pull/410#issuecomment-593307519
 
 
   > How about extracting that code into a behavior, e.g. something which can be added to a button?
   > This would be much nicer to use (showing/hiding the button, keeping track of the currrent Ajax request, cancelling it).
   > With its own JS file we could keep this stuff out of the core JS, maybe add this feature to wicket-extensions.
   
   @svenmeier Many thanks for feedback. This sounds like a very good idea. I will do that and create a new PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services