You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Calling a JavaScript function on a component's onclick:

...

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;
      }
    }
  }
}

...

Also see Calling Wicket from Javascript

  • No labels