views:

1280

answers:

1

I am currently working on a web app using Wicket and started using jQuery core (UI also) in it today. I ran into an issue I troubleshooted as a jQuery function (show(), slideDown()) colliding with some of the javascript Wicket auto-generated for an external form link.

Before I get deeper into this project I am wondering if anyone has had similar experiences. Are there a lot of places where the jQuery effects/actions collide with Wicket generated javascript/HTML? Are there clean ways to avoid this, or mitigate it?

I have seen Wicketext as possibly a cleaner "integrator" of the two, but mostly it seems to just be a way of doing more of the jQuery-ish code in the Java instead of JS.

+1  A: 

This is an interesting problem since jQuery occupies it's own namespace. I'm guessing that there is a conflict with the $ jQuery variable. To get around this you can have jQuery occupy a different namespace like so:

var $j = jQuery.noConflict();

You can do this after you've loaded both sets of code and the $ will be returned to its original value. A bit of a headache but it can fix things in a pinch. See using jQuery with other libraries for more info.

codeincarnate
Thanks codeincarnate! I'll give it a try on monday and see what happens.
Scanningcrew
So this didn't work, but I believe it to be another issue with Wicket generated JS. Had it been a library collision I think your answer is spot on so I am accepting it.
Scanningcrew