Versions Compared

Key

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

...

Code Block
public void init() {
  super.init();

  IJavaScriptLibrarySettings jsSettings = getJavaScriptLibrarySettings();

  jsSettings.setJQueryReference(new MyJQueryReference());

  jsSettings.setWicketEventReference(new DojoWicketEventReference());
  
  jsSettings.setWicketAjaxReference(new DojoWicketAjaxReference());

}

...

Code Block
  Wicket.Ajax.get({"u":"the/url/to/the/link", "e": "click", "c":"linkId"});

...

Many of the attributes have default values which are not written in the JSON settings and they are initialized at the client side (i.e. wicket-ajax.js knows the defaults). The example above can be read as: when HTML element with id 'linkId' is clicked fire an Ajax call with Url 'the/url/to/the/link'.
If you need more examples how to use it from JS, take a look at wicket sources: wicket-core/src/test/js/ajax.js

Migration steps

o.a.w.ajax.IAjaxCallDecorator is replaced with o.a.w.ajax.attributes.IAjaxCallListener.

...

An introduction to the new functionalities are described at Wicket In Action. There is also a link to a demo application.

FAQ
Anchor
faq
faq

How to check whether my custom version of the backing JavaScript library (jQuery) doesn't break Wicket internals somehow ?

  1. Clone Wicket from its Git repository
    git clone http://git-wip-us.apache.org/repos/asf/wicket.gitImage Removed
  2. Open wicket-core/src/test/js/all.html and change it to point to your version of the backing library.
  3. Run the non-Ajax tests by opening file:///path/to/wicket/wicket-core/src/test/js/all.htmlImage Removed
  4. To run the Ajax tests see the description at the top of wicket-core/src/test/js/ajax.js. It is required to run them through Web Server

...