This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new ad6ecac  WICKET-6703 updated javadoc
ad6ecac is described below

commit ad6ecac7fdebefc25d310361f3a92aa481c36b1f
Author: Sven Meier <[email protected]>
AuthorDate: Thu Nov 21 23:30:08 2019 +0100

    WICKET-6703 updated javadoc
---
 .../handler/IPartialPageRequestHandler.java        | 42 ++++++++++++----------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git 
a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPartialPageRequestHandler.java
 
b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPartialPageRequestHandler.java
index da126a2..4db9e98 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPartialPageRequestHandler.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/core/request/handler/IPartialPageRequestHandler.java
@@ -64,30 +64,36 @@ public interface IPartialPageRequestHandler extends 
IPageRequestHandler
        void addChildren(MarkupContainer parent, Class<?> childCriteria);
 
        /**
-        * 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>
+        * Add JavasSript that will be evaluated on the client side after 
components are replaced
+        * <p>
+        * If the JavaScript needs to do something asynchronously (i.e. uses 
window.setTimeout(), for example
+        * to do animations), it may call 
<code>Wicket.Ajax.suspendCall()</code> to suspend the evaluation of the current
+        * Ajax call. The returned function has to be called when the 
asynchronous task is finished, after which the evaluation
+        * of the Ajax call is continued, e.g.
+        * <pre>
+        * target.appendJavaScript("var continueCall = 
Wicket.Ajax.suspendCall(); try { ... } finally { continueCall(); }");
+        * </pre>
+        * <strong>Important</strong>: it is recommended to execute your code 
in try/finally to make sure
+        * the function is executed even if an error happens in your code, 
otherwise all following scripts and
+        * component replacements wont be made.
         *
         * @param javascript
         */
        void appendJavaScript(CharSequence javascript);
 
        /**
-        * 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>
+        * Add JavaScript that will be evaluated on the client side before 
components are replaced.
+        * <p>
+        * If the JavaScript needs to do something asynchronously (i.e. uses 
window.setTimeout(), for example
+        * to do animations), it may call 
<code>Wicket.Ajax.suspendCall()</code> to suspend the evaluation of the current
+        * Ajax call. The returned function has to be called when the 
asynchronous task is finished, after which the evaluation
+        * of the Ajax call is continued, e.g.
+        * <pre>
+        * target.prependJavaScript("var continueCall = 
Wicket.Ajax.suspendCall(); try { ... } finally { continueCall(); }");
+        * </pre>
+        * <strong>Important</strong>: it is recommended to execute your code 
in try/finally to make sure
+        * the function is executed even if an error happens in your code, 
otherwise all following scripts and
+        * component replacements wont be made.
         *
         * @param javascript
         */

Reply via email to