Thanks Martijn for your replies. I have just found them.

On 2012-11-13 13:23, Martijn Dashorst wrote:
> If you don't have a common base page for all your pages, then you can
> use a ComponentInstantiationListener that adds a behavior to all
> pages, rendering the specific javascript invocations.
> 
> Else, just override the renderHead(IHeaderResponse) method in your
> base page and do the javascript voodoo there.

I tried the solution with renderHead(IHeaderResponse), but both
JavaScriptHeaderItem.forScript() and OnDomReadyHeaderItem.forScript()
generates script in the wrong place (between my script and JQuery from
Wicket or after jQuery and my script which already generates JS errors).
I need something which will be inserted just after jquery from Wicket,
before my custom scripts which are also inserted on particular pages in
renderHead(). ComponentInstantiationListener probably works in the same way.
In addition adding "jQuery.noConflict();" globally for all my pages
generates full jQuery import also on pages where no Java Script is used
(probably small impact, but always).

Thereupon I think that an ability to simply switch jquery to a
non-conflict mode would be a nice feature for people having problems
similar to mine.

Marcin



> On Mon, Nov 12, 2012 at 8:44 AM, Martin Grigorov <mgrigo...@apache.org> wrote:
>> Hi,
>>
>> For wicket-examples'
>> http://www.wicket-library.com/wicket-examples-6.0.x/ajax/effects<http://www.wicket-library.com/wicket-examples-6.0.x/ajax/effects?1>
>> all
>> I had to do was to add
>>
>> @Override
>> public void renderHead(IHeaderResponse response)
>> {
>> super.renderHead(response);
>>
>> response.render(OnDomReadyHeaderItem.forScript("jQuery.noConflict();"));
>> }
>>
>> to the page that uses Prototype (EffectsPage.java).
>>
>> But it is quite simple demo so maybe more work is needed in a real use case
>> like yours.
>>
>>
>> On Mon, Nov 12, 2012 at 2:58 AM, Marcin Zajączkowski <msz...@wp.pl> wrote:
>>
>>> Hi, I have an application which internally uses prototype. After
>>> migration from Wicket 1.5 to 6 I had problems with conflicts. It helped
>>> to enable non conflict mode in jQuery, but to do this globally I had to
>>> do a few things:
>>>  - an one line script
>>>  - a corresponding JavaScriptResourceReference
>>>  - a new JavaScriptBundle which bundle it with the original one
>>>  - set a jQueryReference to my bundle
>>>
>>> Is there any simpler way to do that? There is probably more people
>>> facing with that problem and some build in solution which be useful.
>>>
>>> Regards
>>> Marcin
>>>
>>> --
>>> http://blog.solidsoft.info/ - Working code is not enough
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com <http://jweekend.com/>
> 
> 
> 


-- 
http://blog.solidsoft.info/ - Working code is not enough



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to