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 2016/04/19 23:57:06 UTC

wicket git commit: WICKET-6148 Remove AjaxEventBehavior#onCheckEvent() before Wicket 8.0.0

Repository: wicket
Updated Branches:
  refs/heads/master 3e443408e -> 20cf8ee34


WICKET-6148 Remove AjaxEventBehavior#onCheckEvent() before Wicket 8.0.0


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

Branch: refs/heads/master
Commit: 20cf8ee341a0aab994c9e9a102687a9a3e88e27a
Parents: 3e44340
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Apr 19 23:56:49 2016 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Apr 19 23:56:49 2016 +0200

----------------------------------------------------------------------
 .../apache/wicket/ajax/AjaxEventBehavior.java   | 26 +++++++++-----------
 1 file changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/20cf8ee3/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
index 7be3d9e..a0456a4 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxEventBehavior.java
@@ -112,9 +112,21 @@ public abstract class AjaxEventBehavior extends AbstractDefaultAjaxBehavior
 	 * 
 	 * @param event
 	 *      the event this behavior will be attached to
+	 * @deprecated Wicket 8 Remove this method for Wicket 8.0.0
 	 */
+	@Deprecated
 	protected void onCheckEvent(final String event)
 	{
+		if (event.startsWith("on"))
+		{
+			String shortName = event.substring(2);
+			throw new IllegalArgumentException(
+					String.format("Since version 6.0.0 Wicket uses JavaScript event registration so there is no need of the leading " +
+									"'on' in the event name '%s'. Please use just '%s'. Wicket 8.x won't manipulate the provided event " +
+									"names so the leading 'on' may break your application."
+							, event, shortName));
+		}
+
 	}
 
 	/**
@@ -129,16 +141,6 @@ public abstract class AjaxEventBehavior extends AbstractDefaultAjaxBehavior
 		{
 			if (Strings.isEmpty(evt) == false)
 			{
-				if (evt.startsWith("on"))
-				{
-					String shortName = evt.substring(2);
-					// TODO Wicket 8 Change this to throw an error in the milestone/RC versions and remove it for the final version
-					LOGGER.warn("Since version 6.0.0 Wicket uses JavaScript event registration so there is no need of the leading " +
-							"'on' in the event name '{}'. Please use just '{}'. Wicket 8.x won't manipulate the provided event " +
-							"names so the leading 'on' may break your application."
-							, evt, shortName);
-					evt = shortName;
-				}
 				cleanedEvents.add(evt);
 			}
 		}
@@ -146,10 +148,6 @@ public abstract class AjaxEventBehavior extends AbstractDefaultAjaxBehavior
 		return Strings.join(" ", cleanedEvents);
 	}
 
-	/**
-	 * 
-	 * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(AjaxRequestTarget)
-	 */
 	@Override
 	protected final void respond(final AjaxRequestTarget target)
 	{