Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
...

new AjaxLink("link") {
  protected onClick(AjaxRequestTarget target) { ...}
  protected IAjaxCallDecorator getAjaxCallDecorator() {
    return new AjaxCallDecorator() {
      public CharSequence decorateScript(CharSequence script) {
        return "alert('This is my javascript call'); " + script;
      }
    }
  }
}

...

An alternative approach:

Code Block

link.add(new AttributeAppender("onclick", new Model("alert('This is my JS script');"), ";"));

Also see HOWTO do Javscript call after each Wicket AJAX update