...
Code Block |
---|
public void init() { super.init(); // this is the reference to JQuery getAjaxSettingsgetJavaScriptLibrarySettings().setBackingLibraryReference(new JavaScriptResourceReference(....))DojoReference.class); // wicket-event.js getAjaxSettingsgetJavaScriptLibrarySettings().setWicketEventReference(new JavaScriptResourceReference(....)); // wicket-ajax.jsDojoWicketEventReference.class); getAjaxSettingsgetJavaScriptLibrarySettings().setWicketAjaxReference(new JavaScriptResourceReference(....))DojoWicketAjaxReference.class); } |
Since Wicket 6.0 ResourceReference can have dependencies and it is recommended to properly define the dependency chain between this classes.
See the code of org.apache.wicket.ajax.WicketAjaxJQueryResourceReference to see how the default JQuery based implementation does that.
If the user application needs to This way the user application can upgrade/downgrade to new/old version of JQuery or even use YUI as backing library with the respective implementations of wicket-ajax and wicket-event based on YUI.then just the first line above is needed:
Code Block |
---|
getJavaScriptLibrarySettings().setBackingLibraryReference(AnotherVersionOfJQueryReference.class);
|