you can put the javascript that uses your library into window's onload or ondomready event, so it will be executed later. wicket-event.js and WicketEventReference class make it easy.
another approach is to simply output the javascript that uses the lib via a headercontributor as well. there is a nice one that works with TextTemplate class. -igor On Sun, Jun 22, 2008 at 10:10 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote: > Ok, > > I understand your point and perhaps my whole setup is wrong. Here is my line > of thinking: > > 1. I have a component that needs some Javascript. > 2. The Javascript relies on an external library. > 3. There may be several instances of the component on the page. > 4. Other components on the page may have some Javascript as well and > may also need the same library. > 5. I want to make sure that the library is loaded only once (which > I can achieve nicely with a HeaderContributor) > > Is there some other way to handle this situation? > > J. > > Igor Vaynberg wrote: >> >> if we switch the ordering then someone else will complain :) >> >> maybe they add a javascript library via wickethead and have a >> contributor spitting out some dynamic javascript. >> >> point is its a bad idea to depend on the ordering, whichever way it >> currently is. >> >> -igor >> >> On Sun, Jun 22, 2008 at 9:52 AM, Jürgen Lind <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi, >>> >>> as far as I noticed, Wicket first writes the code fragments of >>> wicket:head >>> into the page and then the parts provided by the HeaderContributors. Is >>> there >>> a way of changing that ordering? The background is that I want to load a >>> javascript library with a HeaderContributor and then use that library >>> within >>> the wicket:head section. >>> >>> Regards, >>> >>> J. >>> >>> -- >>> Dr. Jürgen Lind >>> iteratec GmbH Fon: +49 (0)89 614551-44 >>> Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 >>> 82008 Unterhaching Web: www.iteratec.de >>> >>> Sitz und Registergericht der iteratec GmbH: München HRB 113 519 >>> Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- > Mit freundlichen Grüßen, > > Jürgen Lind > > -- > Dr. Jürgen Lind > iteratec GmbH Fon: +49 (0)89 614551-44 > Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 > 82008 Unterhaching Web: www.iteratec.de > > Sitz und Registergericht der iteratec GmbH: München HRB 113 519 > Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
