Sound like a good approach, I guess then if there were something like this components that would allow sharing of css etc (static css,js etc components) should just add to headercontribmanager, and ones that should not would just use the "old way". However it could be nice with some settings for this, sometimes it's just not feasible to merge like if you have a lot of components that are only shown 10% of the time or so..

richardwilko wrote:
Hi,

A few months back I started work on a slightly different method of adding
resources to a page, where, it works out what resources are added on the
page, combines them together with the yui javascript compressor, caches the
result, and serves it.

Unfortunately I haven't had any time to work on it as my new job has taken
me away from wicket, but I am happy to share my rough code with anyone that
wants it.
:( and :)
resources are added like so:
HeaderContribManager.add(new ResourceReference(...), getPage());

and in each page add
HeaderContribManager.getHeaderContributor(this.class, localString,
styleString);

in both cases put in the onBeforeRender method (the panels and such need to
be added to the page before you can use getPage() afaik)

Like I said its very rough, but it does have the advantage of producing a js
file for each page, hopefully taking into account local and style, and
should work when a panel adds javascript, and you use that panel in multiple
pages.

http://www.nabble.com/file/p19170189/HeaderContribManager.java
HeaderContribManager.java

<[EMAIL PROTECTED]> wrote:
I've been hearing some rants on how merging resources can up the
performance, should wicket be able todo this? I mean merging several
css's
into one etc.. I know it wont work for dynamic css/js/images. But on
static
it could, even yslow recommends you merge your resources into one... Images
might be stretching it too far?

WDYT?


http://workingwithrails.com/railsplugin/5317-asset-packager
http://www.kaboomerang.com/blog/2007/11/29/getting-to-10-actiontastic-actionatr-gwt-and-automagic-rest/



-----
http://www.richard-wilkinson.co.uk My blog:
http://www.richard-wilkinson.co.uk

--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to