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 2012/01/18 11:37:56 UTC

[8/9] git commit: WICKET-3367 Rewrite all JavaScript inline event handlers to be proper attached event handlers

WICKET-3367
Rewrite all JavaScript inline event handlers to be proper attached event handlers

Add javadoc for postprocessAttributes() method.


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

Branch: refs/heads/master
Commit: ed86660d9fc4bf213151929f8f5904a45858f03d
Parents: fa18e13
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed Jan 18 09:37:05 2012 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Jan 18 09:37:05 2012 +0100

----------------------------------------------------------------------
 .../wicket/ajax/AbstractDefaultAjaxBehavior.java   |   16 +++++++++++++-
 1 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/ed86660d/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
index 23db554..8f30b6e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractDefaultAjaxBehavior.java
@@ -22,6 +22,7 @@ import java.util.Map.Entry;
 
 import org.apache.wicket.Component;
 import org.apache.wicket.Page;
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.ajax.attributes.AjaxCallListener;
 import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
 import org.apache.wicket.ajax.attributes.AjaxRequestAttributes.Method;
@@ -388,7 +389,7 @@ public abstract class AbstractDefaultAjaxBehavior extends AbstractAjaxBehavior
 		}
 		catch (JSONException e)
 		{
-			throw new RuntimeException(e);
+			throw new WicketRuntimeException(e);
 		}
 
 		String attributesAsJson = attributesJson.toString();
@@ -396,7 +397,18 @@ public abstract class AbstractDefaultAjaxBehavior extends AbstractAjaxBehavior
 		return attributesAsJson;
 	}
 
-	protected void postprocessConfiguration(JSONObject object, Component component)
+	/**
+	 * Gives a chance to modify the JSON attributesJson that is going to be used as
+	 * attributes for the Ajax call.
+	 *
+	 * @param attributesJson
+	 *      the JSON object created by #renderAjaxAttributes()
+	 * @param component
+	 *      the component with the attached Ajax behavior
+	 * @throws JSONException
+	 *      thrown if an error occurs while modifying {@literal attributesJson} argument
+	 */
+	protected void postprocessConfiguration(JSONObject attributesJson, Component component)
 		throws JSONException
 	{
 	}