Comment appeler Javscript après la mise à jour AJAX, Wicket

Comment appeler Javscript après la mise à jour AJAX, Wicket

Problème

Selon cethis Wicket article. If we want to run a certain piece of Javascript code after every Ajax update, we can uses “wicketGlobalPostCallHandler” like this :

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

Cependant, la solution ne fonctionne tout simplement pas pour moi.

Solution

Vous pouvez également utiliser «ajaxRequestTarget» pour ajouter le code Javascrip:

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