wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Vaynberg" <igor.vaynb...@gmail.com>
Subject Re: Can you control the order of <wicket:head> contra added headercontributors?
Date Fri, 01 Feb 2008 21:57:23 GMT
if you put the reference to jquery into wicket:head of the base page
will it load before or after? then put only your initialization code
into a header contributor.

-igor


On Feb 1, 2008 12:54 PM, Edvin Syse <edvin@sysedata.no> wrote:
> > not sure we support that, or want to support it...
> > if you are using a headercontributor in one situation, why not use it
> > also in your child page?
> > -igor
>
> In my childpage, the head-section actually does more than just load the other javascript-file.
It also does initialization for the
> jquery-components etc, like for example:
>
>         $('#lang > li').hover(
>                 function () {
>                         $(this).find('ul').removeClass('collapsed');
>                 },
>                 function () {
>                         $(this).find('ul').addClass('collapsed');
>                 }
>         );
>
> When my webdesigner needs to add stuff like that to a subpage, he can't add it to the
head, because it will be rendered before jquery etc.
> Then, for every page he needs to do some jquery-magick in, I need to go:
>
> response.renderJavascriptReference(new ResourceReference(ThisSubPage.class, "extra-init-stuff-for-that-page.js"));
>
> .. in that particular page. And he needs to put the js-stuff in this separate file instead
of the head of the subpage, where it belongs.
>
> It's OK for webdevelopers that does design/css themselves, but a real pain when you have
designers working on your project.
>
> Can you think of a good solution for this given the current possibilities in Wicket?
>
> -- Edvin
>
>
>
> >
> >
> > On Feb 1, 2008 5:52 AM, Edvin Syse <edvin@sysedata.no> wrote:
> >> Hi,
> >>
> >> I have a basepage which adds a reference to jquery amongst other things
> >> in its constructor via add(IHeaderContributor). Then I extend that
> >> basepage in other pages.
> >>
> >> If I want to add another javascript-reference that utilizes jquery in
> >> the <wicket:head> tag of the childpage, I run into trouble because the
> >> <wicket:head> tag is rendered before the headercontributors from the
> >> basepage, hence the code fails because jquery is not yet loaded (this
> >> happens for many jquery-addons if they are added before jquery.js).
> >>
> >> Is there a way to tell Wicket that wicket:head should be rendered later
> >> than the headercontributors or something, or can I in any way change the
> >> order of what's added to the head section?
> >>
> >> -- Edvin
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message