According to this Apache Wicket article. If we want to run a certain piece of Javascript code after every Ajax update, we can include the following Javascript code into our html code

wicketGlobalPostCallHandler = function {
  alert('successful partial update');
}

You may try above solution, but “wicketGlobalPostCallHandler” solution just does not work for me. I find another more easy way to execute my Javascript after Ajax update in Wicket. Here is the code

ajaxRequestTarget.appendJavascript("alert('hello');");

By using appendJavascript method in ajaxRequestTarget class, i can easily call my Javascript after every Ajax update in Wicket. :)

This article was posted in Wicket category.

Related Posts