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 2013/02/06 09:52:00 UTC

[18/38] git commit: Improve the javadoc and fix the order of the arguments a listener method will receive

Improve the javadoc and fix the order of the arguments a listener method will receive


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

Branch: refs/heads/reference-guide
Commit: a908236bb68e15ef28e32de8b5d0acb5b874d689
Parents: 1b784db
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Jan 29 11:58:21 2013 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Jan 29 11:58:21 2013 +0100

----------------------------------------------------------------------
 .../wicket/ajax/attributes/IAjaxCallListener.java  |   25 +++++++++-----
 1 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a908236b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/IAjaxCallListener.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/IAjaxCallListener.java b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/IAjaxCallListener.java
index ec77351..224f475 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/IAjaxCallListener.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/attributes/IAjaxCallListener.java
@@ -19,12 +19,18 @@ package org.apache.wicket.ajax.attributes;
 import org.apache.wicket.Component;
 
 /**
- * Interface used to listen at the most important points when Wicket performs an Ajax callback. <br/>
- * Ajax call listeners are potential contributors to the page header by implementing
+ * Interface used to listen at the most important points when Wicket performs an Ajax callback.
+ *
+ * <p>Each method can return JavaScript that will be used as a body of a function that is executed
+ * at the appropriate time. If the method returns {@code null} or an empty string then it is ignored
+ * and no function will be executed for this listener. Each JavaScript function receives arguments
+ * in the exact order as specified in the method's javadoc.</p>
+ *
+ *  <p>Ajax call listeners are potential contributors to the page header by implementing
  * {@link org.apache.wicket.markup.html.IComponentAwareHeaderContributor}. E.g. the JavaScript used
  * by the listener may depend on some JavaScript library, by implementing
  * {@link org.apache.wicket.markup.html.IComponentAwareHeaderContributor} interface they can assure
- * it will be loaded.
+ * it will be loaded.</p>
  * 
  * @since 6.0
  */
@@ -45,7 +51,7 @@ public interface IAjaxCallListener
 	CharSequence getBeforeHandler(Component component);
 
 	/**
-	 * A JavaScript function that is invoked before the request executes. If it returns
+	 * A JavaScript function that is invoked before the request is being executed. If it returns
 	 * {@code false} then the execution of the Ajax call will be cancelled. The script will be
 	 * executed in a function that receives the following parameters:
 	 * <ol>
@@ -60,7 +66,7 @@ public interface IAjaxCallListener
 	CharSequence getPrecondition(Component component);
 
 	/**
-	 * The JavaScript that will be executed right before make of the the Ajax call, only if all
+	 * The JavaScript that will be executed right before the execution of the the Ajax call, only if all
 	 * preconditions pass. The script will be executed in a function that receives the following
 	 * parameters:
 	 * <ol>
@@ -83,7 +89,8 @@ public interface IAjaxCallListener
 	 * </ol>
 	 * <strong>Note</strong>: if the Ajax call is synchronous (see
 	 * {@link AjaxRequestAttributes#setAsynchronous(boolean)}) then this JavaScript will be executed
-	 * after the {@linkplain #getCompleteHandler(org.apache.wicket.Component) complete handler}.
+	 * after the {@linkplain #getCompleteHandler(org.apache.wicket.Component) complete handler},
+	 * otherwise it is executed right after the execution of the Ajax request.
 	 * 
 	 * @param component
 	 *            the Component with the Ajax behavior
@@ -96,10 +103,10 @@ public interface IAjaxCallListener
 	 * The JavaScript that will be executed after successful return of the Ajax call. The script
 	 * will be executed in a function that receives the following parameters:
 	 * <ol>
+	 * <li>attrs - the AjaxRequestAttributes as JSON</li>
+	 * <li>jqXHR - the jQuery XMLHttpRequest object</li>
 	 * <li>data - the Ajax response. Its type depends on {@link AjaxRequestAttributes#dataType}</li>
 	 * <li>textStatus - the status as text</li>
-	 * <li>jqXHR - the jQuery XMLHttpRequest object</li>
-	 * <li>attrs - the AjaxRequestAttributes as JSON</li>
 	 * </ol>
 	 * 
 	 * @param component
@@ -125,9 +132,9 @@ public interface IAjaxCallListener
 	 * The JavaScript that will be executed after both successful and unsuccessful return of the
 	 * Ajax call. The script will be executed in a function that receives the following parameters:
 	 * <ol>
+	 * <li>attrs - the AjaxRequestAttributes as JSON</li>
 	 * <li>jqXHR - the jQuery XMLHttpRequest object</li>
 	 * <li>textStatus - the status as text</li>
-	 * <li>attrs - the AjaxRequestAttributes as JSON</li>
 	 * </ol>
 	 * 
 	 * @param component