You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/08/18 11:28:06 UTC

[1/2] git commit: WICKET-5676 Double click causes internal error using AjaxFallbackDefaultDataTable

Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x 64c8567fe -> 5af8ea44e


WICKET-5676 Double click causes internal error using AjaxFallbackDefaultDataTable

Use the default channel name for Ajax navigation links


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7ff5623b
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7ff5623b
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7ff5623b

Branch: refs/heads/wicket-6.x
Commit: 7ff5623b9af4e4b1ddfd3dee8d5bfde775de09c0
Parents: 64c8567
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Aug 18 12:26:01 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Aug 18 12:26:01 2014 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/wicket/ajax/AjaxChannel.java   | 12 +++++++++++-
 .../paging/AjaxPagingNavigationIncrementLink.java       |  4 +---
 .../navigation/paging/AjaxPagingNavigationLink.java     |  4 +---
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/7ff5623b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxChannel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxChannel.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxChannel.java
index e60a5c3..45b050c 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxChannel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxChannel.java
@@ -58,9 +58,19 @@ public class AjaxChannel implements IClusterable
 	}
 
 	/**
+	 * The name of the default channel
+	 */
+	public static final String DEFAULT_NAME = "0";
+
+	/**
+	 * The type of the default channel
+	 */
+	public static final Type DEFAULT_TYPE = Type.QUEUE;
+
+	/**
 	 * The default channel for all Ajax calls
 	 */
-	public static final AjaxChannel DEFAULT = new AjaxChannel("0", Type.QUEUE);
+	public static final AjaxChannel DEFAULT = new AjaxChannel(DEFAULT_NAME, DEFAULT_TYPE);
 
 	private final String name;
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/7ff5623b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationIncrementLink.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationIncrementLink.java b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationIncrementLink.java
index 6f47714..0dcd652 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationIncrementLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationIncrementLink.java
@@ -51,8 +51,6 @@ public class AjaxPagingNavigationIncrementLink extends PagingNavigationIncrement
 {
 	private static final long serialVersionUID = 1L;
 
-	public static final String PAGING_CHANNEL_NAME = "ajax-paging";
-
 	/**
 	 * Constructor.
 	 * 
@@ -94,7 +92,7 @@ public class AjaxPagingNavigationIncrementLink extends PagingNavigationIncrement
 			protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
 			{
 				super.updateAjaxAttributes(attributes);
-				attributes.setChannel(new AjaxChannel(PAGING_CHANNEL_NAME, AjaxChannel.Type.ACTIVE));
+				attributes.setChannel(new AjaxChannel(AjaxChannel.DEFAULT_NAME, AjaxChannel.Type.ACTIVE));
 				AjaxPagingNavigationIncrementLink.this.updateAjaxAttributes(attributes);
 			}
 		};

http://git-wip-us.apache.org/repos/asf/wicket/blob/7ff5623b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationLink.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationLink.java b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationLink.java
index c8bcb47..05e2f85 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationLink.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/markup/html/navigation/paging/AjaxPagingNavigationLink.java
@@ -16,8 +16,6 @@
  */
 package org.apache.wicket.ajax.markup.html.navigation.paging;
 
-import static org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigationIncrementLink.PAGING_CHANNEL_NAME;
-
 import org.apache.wicket.ajax.AjaxChannel;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
@@ -78,7 +76,7 @@ public class AjaxPagingNavigationLink extends PagingNavigationLink<Void> impleme
 			protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
 			{
 				super.updateAjaxAttributes(attributes);
-				attributes.setChannel(new AjaxChannel(PAGING_CHANNEL_NAME, AjaxChannel.Type.ACTIVE));
+				attributes.setChannel(new AjaxChannel(AjaxChannel.DEFAULT_NAME, AjaxChannel.Type.ACTIVE));
 				AjaxPagingNavigationLink.this.updateAjaxAttributes(attributes);
 			}
 		};


[2/2] git commit: Improve comments, logs and variable names. No functional changes

Posted by mg...@apache.org.
Improve comments, logs and variable names. No functional changes


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5af8ea44
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5af8ea44
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5af8ea44

Branch: refs/heads/wicket-6.x
Commit: 5af8ea44e905fb70390e129e93ff1862ea1ff30d
Parents: 7ff5623
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Aug 18 12:27:35 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Aug 18 12:27:35 2014 +0300

----------------------------------------------------------------------
 .../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5af8ea44/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index ee05cd8..694ef0e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -261,7 +261,7 @@
 			var res = name.match(/^([^|]+)\|(d|s|a)$/);
 			if (isUndef(res)) {
 				this.name = '0'; // '0' is the default channel name
-				this.type = 's'; // default to stack
+				this.type = 's'; // default to stack/queue
 			}
 			else {
 				this.name = res[1];
@@ -282,14 +282,14 @@
 				}
 			} else {
 				var busyChannel = "Channel '"+ this.name+"' is busy";
-				if (this.type === 's') { // stack
+				if (this.type === 's') { // stack/queue
 					Wicket.Log.info(busyChannel + " - scheduling the callback to be executed when the previous request finish.");
 					this.callbacks.push(callback);
 				}
 				else if (this.type === 'd') { // drop
-					Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduled a new one to be executed when the current request finish.");
+					Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduling a new one to be executed when the current request finish.");
 					this.callbacks = [];
-					this.callbacks[0] = callback;
+					this.callbacks.push(callback);
 				} else if (this.type === 'a') { // active
 					Wicket.Log.info(busyChannel + " - ignoring the Ajax call because there is a running request.");
 				}
@@ -298,17 +298,17 @@
 		},
 
 		done: function () {
-			var c = null;
+			var callback = null;
 
 			if (this.callbacks.length > 0) {
-				c = this.callbacks.shift();
+				callback = this.callbacks.shift();
 			}
 
-			if (c !== null && typeof(c) !== "undefined") {
+			if (callback !== null && typeof(callback) !== "undefined") {
 				Wicket.Log.info("Calling postponed function...");
 				// we can't call the callback from this call-stack
 				// therefore we set it on timer event
-				window.setTimeout(c, 1);
+				window.setTimeout(callback, 1);
 			} else {
 				this.busy = false;
 			}