You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joseph Pachod <jo...@thomas-daily.de> on 2010/09/09 22:09:46 UTC

Header requiring to be contributed through page load and not ajax...

hi

It looks like the jquery files need to be included through a normal page load. Contributing these headers through Ajax doesn't work, I guess it's due to the use of  $(document).ready(function(), which isn't triggered on ajax refresh.


I tried to find a jquery workaround for that but without success up to now (I'm no jquery expert).

As such, I'm facing this strange requirement of having some headers contributed only through normal page load, which would most probably mean on first page display.
As some components are made visible/added through ajax only, I don't see how to fulfil this need. 

Currently, I just try to add manually the required headers on each page which might use one of the component requiring these headers...
For it to be perfectly bulletproof, I would have to add them to all pages by default, but I find this quite bullish (and potentially slowing down deeply the first access).

Do you have any better solution?

thanks in advance
joseph

Re: Header requiring to be contributed through page load and not ajax...

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Igor Vaynberg wrote:
> dunno then, you may want to talk to jquery people and see what they
> recommend. we cant really fire the onload event again because some
> scripts may have already been executed...like i said, see what jquery
> folks say.
>   
thanks anyway

as jquery integration is fairly common I was wondering if some 
workaround was known (better than always putting in all pages all jquery 
related files in the header)

regarding the jquery folks, well, their forum isn't as good as this one 
and their documentation is silent on the topic: no answer found up to now

++

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


Re: AW: Header requiring to be contributed through page load and not ajax...

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Stefan Lindner wrote:
> I use onDomReady functionality at many places in my jWicket jQuery-integration. I don't know of any general problem (no guarantee that there isn't one) with jQuery and Wickets onDomReady.
> Of course you have to ensure that the library (and perhaps additional files) is loaded in correct order with other libraries of jQuery. Did you use a debugger (e.g. firebug) to examine your javascript behavior?
>
> Stefan

example of a browser crash:
uncaught exception: [Exception... "Component returned failure code: 
0x804b0049 (NS_ERROR_ALREADY_OPENED) [nsIXMLHttpRequest.send]"  
nsresult: "0x804b0049 (NS_ERROR_ALREADY_OPENED)"  location: "JS frame :: 
http://localhost:8080/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js 
:: anonymous :: line 841"  data: no]
 

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


Re: AW: Header requiring to be contributed through page load and not ajax...

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Stefan Lindner wrote:
> I use onDomReady functionality at many places in my jWicket jQuery-integration. I don't know of any general problem (no guarantee that there isn't one) with jQuery and Wickets onDomReady.
> Of course you have to ensure that the library (and perhaps additional files) is loaded in correct order with other libraries of jQuery. Did you use a debugger (e.g. firebug) to examine your javascript behavior?
>
> Stefan
>   
thanks for this answer Stefan

Let's go for an exemple: there is no jquery related header, and then an 
ajax request contributes the required header lib (in the proper order, 
or at least so is it when loading "normally"). Then any jquery code 
executed afterwards fail, for example with "$ is not defined" and 
sometimes, with some plugins, in a worse way (like browser crash). In 
these cases the debugger wasn't working at all, in the previous it was 
fairly obvious that some jquery init hadn't been done.

when the jquery and plugins files are present on page load, none of 
these issues appear.

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


AW: Header requiring to be contributed through page load and not ajax...

Posted by Stefan Lindner <li...@visionet.de>.
I use onDomReady functionality at many places in my jWicket jQuery-integration. I don't know of any general problem (no guarantee that there isn't one) with jQuery and Wickets onDomReady.
Of course you have to ensure that the library (and perhaps additional files) is loaded in correct order with other libraries of jQuery. Did you use a debugger (e.g. firebug) to examine your javascript behavior?

Stefan

-----Ursprüngliche Nachricht-----
Von: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Gesendet: Donnerstag, 9. September 2010 22:42
An: users@wicket.apache.org
Betreff: Re: Header requiring to be contributed through page load and not ajax...

dunno then, you may want to talk to jquery people and see what they recommend. we cant really fire the onload event again because some scripts may have already been executed...like i said, see what jquery folks say.

-igor

On Thu, Sep 9, 2010 at 1:38 PM, Joseph Pachod <jo...@thomas-daily.de> wrote:
> instead of  $(document).ready(function() use wicket's
>  iheadercontributor's response.writeondomreadyjavascriptthanks for the 
> answer
>
> I do so for my own stuff, but jquery plugin don't.
>
> similarly, the core jquery file import won't work when added through ajax.
>
>

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


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


Re: Header requiring to be contributed through page load and not ajax...

Posted by Igor Vaynberg <ig...@gmail.com>.
dunno then, you may want to talk to jquery people and see what they
recommend. we cant really fire the onload event again because some
scripts may have already been executed...like i said, see what jquery
folks say.

-igor

On Thu, Sep 9, 2010 at 1:38 PM, Joseph Pachod
<jo...@thomas-daily.de> wrote:
> instead of  $(document).ready(function() use wicket's
>  iheadercontributor's response.writeondomreadyjavascriptthanks for the answer
>
> I do so for my own stuff, but jquery plugin don't.
>
> similarly, the core jquery file import won't work when added through ajax.
>
>

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


Re: Header requiring to be contributed through page load and not ajax...

Posted by Alexander Morozov <al...@gmail.com>.
Hi!

Check this jQ plugin http://docs.jquery.com/Plugins/livequery

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Header-requiring-to-be-contributed-through-page-load-and-not-ajax-tp2533526p2535816.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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


Re: Header requiring to be contributed through page load and not ajax...

Posted by Joseph Pachod <jo...@thomas-daily.de>.
instead of  $(document).ready(function() use wicket's
  iheadercontributor's response.writeondomreadyjavascriptthanks for the answer

I do so for my own stuff, but jquery plugin don't.

similarly, the core jquery file import won't work when added through ajax.

    

Re: Header requiring to be contributed through page load and not ajax...

Posted by Igor Vaynberg <ig...@gmail.com>.
instead of  $(document).ready(function() use wicket's
iheadercontributor's response.writeondomreadyjavascript

-igor

On Thu, Sep 9, 2010 at 1:09 PM, Joseph Pachod
<jo...@thomas-daily.de> wrote:
> hi
>
> It looks like the jquery files need to be included through a normal page load. Contributing these headers through Ajax doesn't work, I guess it's due to the use of  $(document).ready(function(), which isn't triggered on ajax refresh.
>
>
> I tried to find a jquery workaround for that but without success up to now (I'm no jquery expert).
>
> As such, I'm facing this strange requirement of having some headers contributed only through normal page load, which would most probably mean on first page display.
> As some components are made visible/added through ajax only, I don't see how to fulfil this need.
>
> Currently, I just try to add manually the required headers on each page which might use one of the component requiring these headers...
> For it to be perfectly bulletproof, I would have to add them to all pages by default, but I find this quite bullish (and potentially slowing down deeply the first access).
>
> Do you have any better solution?
>
> thanks in advance
> joseph

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