Ok, I expanded the example with some more documentation.
The HeaderContributor interface is part of the example. What I describe here is something you could build yourself; just an example.
Sure, you can associate CSS markup with a Page directly. Just use:
<html> <head> <link rel="stylesheet" type="text/css" href="foo.css"></link>
You have to know which stylesheets you use on that page though, so the whole thing I put my example for is, when you create reusable components, that need some seperate css file(s), that you don't (want to) know about when you create your main page.
Eelco
Gili wrote:
I'm looking at the example and I'm not exactly sure I understand what is going on. So you have your main Page, and then you seem to be including a ListView component whose model consists of the CSS filename.
I don't understand what HeaderContributor is all about (I can't find it in the Javadoc or CVS), nor do I understand how this mechanism causes Wicket to map the CSS filename to a globally-stable URL. Perhaps you could shed some more light on this?
Also is there a way to associate a CSS markup with a Page in a direct fashion? Or must I really use a ListModel/View?
Thanks, Gili
Eelco Hillenius wrote:
See the wiki: http://wicket.sourceforge.net/wiki/doku.php?id=user:include_css_references_for_components for one way to do this.
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
