I have now finished porting my jQueryUI integration to Wicket 6 and I really like the final result! The "extra parameters" introduced in AbstractDefaultAjaxBehavior#getCallbackFunction() really simplified passing information back to Wicket.

I am now trying to make good use of the ResourceReferences to include jQueryUI's javascript file and hitting a bump. Currently, I use the following code in my base page class:

public void renderHead(IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forUrl("jqueryui/jquery-ui-1.8.17.custom.min.js"));
}

"jqueryui/jquery-ui-1.8.17.custom.min.js" is always rendered as a url relative to Wicket's root. I can't use a PackageResource because this script must be accessible by other static pages in the same server root. WICKET-4466 introduced ExternalUrlResourceReference which allows using an absolute url for a resource reference (it's meant for CDNs). This is close to what I need so I forced it to also accept relative urls and it seems to work fine. Is it really necessary to allow only absolute urls? If so, is there another way to achieve what I seek?

Regards,
Bertrand


On 21/07/2012 9:37 AM, Martin Grigorov wrote:

Some comments and questions regarding the migration docs:
Should be added to migration doc:
-MinimumValidator and MaximumValidator are replaced by
RangeValidator.minimum and RangeValidator.maximum respectively
The Wiki is editable by everyone with an account. Just create one and
contribute! ;-)
Done!

 From https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax :
-Very interesting read! If feel it really gave me a good overview of the new
Wicket ajax support.

-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


-Both updateAjaxAttributes exemples include a call to super() but the
javadoc does not mention that calling super() is required. Is it?
It is not required but it is a good practice.
All super impls are currently empty.

-In the AjaxRequestAttributes table, the "preconditions" entry should be
folded in "ajax call listeners" to be consistent. Also, after reading the
code and the text below in "Migration steps", I noticed "ajax call
listeners" is missing the "bsh" and "coh" short names.
Improved!

-In the ajax listener points description, does the "complete handler"
execute after "success handler" or "failure handler" or before? The bullet
point order suggests that it executes after but it's not totally clear.
Perhaps using an ordered list for the listener points or modifying the
description of "complete handler" would clear things up.
Complete handles are executed after either the success or the failure
handlers (if there are any).

I've updated the Wiki page but feel free to further improve it!

Thanks for the great work!
Bertrand
Welcome!
Thanks for the feedback!



Reply via email to