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/21 15:19:47 UTC

[2/2] git commit: WICKET-5039 Manual invocation of FunctionsExecutor#notify() is broken

Updated Branches:
  refs/heads/master 635ced5e2 -> 92700a295


WICKET-5039 Manual invocation of FunctionsExecutor#notify() is broken

Add javadoc about the special support of 'identifier|code'.


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

Branch: refs/heads/master
Commit: 92700a295234dd0d3ddaed1ee9383b47676587c4
Parents: 498f445
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Feb 21 16:18:55 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Feb 21 16:18:55 2013 +0200

----------------------------------------------------------------------
 .../org/apache/wicket/ajax/AjaxRequestTarget.java  |   18 ++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/92700a29/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
index cc10795..637bb01 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
@@ -174,12 +174,28 @@ public interface AjaxRequestTarget extends IPageRequestHandler, ILoggableRequest
 	/**
 	 * Adds javascript that will be evaluated on the client side after components are replaced
 	 *
+	 * <p>If the javascript needs to do something asynchronously (i.e. needs to use window.setTimeout(), for example
+	 * to do animations) then the following special syntax may be used: <code>someFunctionName|myJsLogic(someFunctionName);</code>.
+	 * Wicket will transform it to: <code>function(someFunctionName){myJsLogic(someFunctionName);}</code> and your code
+	 * is responsible to execute <em>someFunctionName()</em> when the asynchronous task is finished. Once <em>someFunctionName</em>
+	 * is executed the next appended script will be executed. <strong>Important</strong>: it is highly recommended to
+	 * execute your code in try/finally to make sure <em>someFunctionName</em> is executed even an error happens in
+	 * your code, otherwise all following scripts wont be executed.</p>
+	 *
 	 * @param javascript
 	 */
 	void appendJavaScript(CharSequence javascript);
 
 	/**
-	 * Adds javascript that will be evaluated on the client side before components are replaced
+	 * Adds javascript that will be evaluated on the client side before components are replaced.
+	 *
+	 * <p>If the javascript needs to do something asynchronously (i.e. needs to use window.setTimeout(), for example
+	 * to do animations) then the following special syntax may be used: <code>someFunctionName|myJsLogic(someFunctionName);</code>.
+	 * Wicket will transform it to: <code>function(someFunctionName){myJsLogic(someFunctionName);}</code> and your code
+	 * is responsible to execute <em>someFunctionName()</em> when the asynchronous task is finished. Once <em>someFunctionName</em>
+	 * is executed the next prepended script will be executed. <strong>Important</strong>: it is highly recommended to
+	 * execute your code in try/finally to make sure <em>someFunctionName</em> is executed even an error happens in
+	 * your code, otherwise all following scripts and component replacements wont be made.</p>
 	 *
 	 * @param javascript
 	 */