-There are references to
IJavaScriptLibrarySettings#setBackingLibraryReference which does not exist
anymore. Is it still possible to change the backing library? I personally
don't want to, but the disparity between the doc and the code confused me.
Fixed!
org.apache.wicket.settings.IJavaScriptLibrarySettings#setJQueryReference


Maybe I don't understand it properly, but the possibility of changing the Wicket's backing library does not seem consistent. The names of the classes and methods for this functionality are one source of confusion. In the first versions of this code, the term "BackingLibrary" was used all over the place but it is now replaced by "JQuery".

For me, it is confusing that Application.get().getJavaScriptLibrarySettings().getJQueryReference() could return a reference to something which is not jQuery at all (e.g. DOJO).

Consider a subclass of JQueryPluginResourceReference whose javadoc states :
* Base class for JavaScript resources that are JQuery plugins. This class already defines a
 * dependency on JQuery.
In its getDependencies() method, it looks up Application.get().getJavaScriptLibrarySettings().getJQueryReference() which can actually be something other than jQuery.

To get around this and protect my ResourceReference from a backing library change, I thought I would add the jQuery dependency myself with JQueryResourceReference, but its javadoc states: * The resource reference for the jquery javascript library as released with Wicket. To add a JQuery
 * resource reference to a component, do not use this reference, but use
* {@link IJavaScriptLibrarySettings#getJQueryReference()} to prevent version conflicts.
So I'm back to square one.

Of course, personally I don't plan on using another backing library, but if this is something which Wicket wants to allow, I think it would be essential to address these issues. I wish I could offer a solution, but I don't currently have one so I decided to share this before 6.0 is released.

Regards,
Bertrand

Reply via email to