You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vasily Vasilkov <ch...@gmail.com> on 2009/02/06 16:36:57 UTC

The same *.css and *.js on multiple pages

Hi

I have a few *.css and javascript files. These files are used by all
pages of my application. Sometimes, I need to change (add/remove)
files in header of my pages. So, what is the easiest way to do this?

P.S. Will HeaderContributor help me?

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


Re: The same *.css and *.js on multiple pages

Posted by Trent Larson <la...@gmail.com>.
One solution is the "extend" functionality (eg. "wicket:child" and
"wicket:extend").  We use a "BasePage" that all our pages extend, and it
contains all our javascript.  It doesn't add anything else, so there is
almost no HTML (just the "html", "head", and "body" tags) and the Java file
for that page is just a blank class.  (Just make sure that, if they add
anything else to the header, all the extending pages use a "wicket:head" tag
for the additional content.)

Trent



On Fri, Feb 6, 2009 at 8:36 AM, Vasily Vasilkov <ch...@gmail.com>wrote:

> Hi
>
> I have a few *.css and javascript files. These files are used by all
> pages of my application. Sometimes, I need to change (add/remove)
> files in header of my pages. So, what is the easiest way to do this?
>
> P.S. Will HeaderContributor help me?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>