You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jürgen Lind <Ju...@iteratec.de> on 2008/06/22 18:52:54 UTC

wicket:head and HeaderContributors

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket:head and HeaderContributors

Posted by Igor Vaynberg <ig...@gmail.com>.
On Sun, Jun 22, 2008 at 11:50 PM, Jürgen Lind <Ju...@iteratec.de> wrote:
> Hi,
>
> Igor Vaynberg wrote:
>>
>> 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.
>
> would sound promising if I would not try to use jQuery that provides me
> with the abstractions for doing onload stuff. Unfortunately, I need the
> library for that :-)
>

like i said, use wicket's event javascript to do that..

-igor

>>
>> 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.
>
> I think that will be the way to go.
>
> Thanks for your help.
>
> J.
>
>>
>> -igor
>>
>> On Sun, Jun 22, 2008 at 10:10 AM, Jürgen Lind <Ju...@iteratec.de>
>> 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 <Ju...@iteratec.de>
>>>> 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: 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
>>>>
>>> --
>>> 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: 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
>>
>
> --
> 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: 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: wicket:head and HeaderContributors

Posted by Jürgen Lind <Ju...@iteratec.de>.
Hi,

Igor Vaynberg wrote:
> 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.

would sound promising if I would not try to use jQuery that provides me
with the abstractions for doing onload stuff. Unfortunately, I need the
library for that :-)

> 
> 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.

I think that will be the way to go.

Thanks for your help.

J.

> 
> -igor
> 
> On Sun, Jun 22, 2008 at 10:10 AM, Jürgen Lind <Ju...@iteratec.de> 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 <Ju...@iteratec.de>
>>> 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: 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
>>>
>> --
>> 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: 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
> 

-- 
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket:head and HeaderContributors

Posted by Igor Vaynberg <ig...@gmail.com>.
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 <Ju...@iteratec.de> 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 <Ju...@iteratec.de>
>> 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: 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
>>
>
> --
> 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: 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: wicket:head and HeaderContributors

Posted by Jürgen Lind <Ju...@iteratec.de>.
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 <Ju...@iteratec.de> 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: 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
> 

-- 
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket:head and HeaderContributors

Posted by Igor Vaynberg <ig...@gmail.com>.
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 <Ju...@iteratec.de> 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: 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