Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added extra info and code for 1.4 users

...

Code Block
add(HeaderContributor.forCss(MyClass.class, "style.css"));

In Wicket 1.4 HeaderContributor.forCss() is deprecated, you can use the code below:

Code Block

add(CSSPackageResource.getHeaderContribution(MyClass.class, "style.css"));

You can add this to any component. Header contribution of style.css relative to MyClass will automatically be taken care off and double contributions will be filtered (ignored). This is my favorite, as you don't need components that have their own markup to do this, you can do this 'inside or outside' of a component, and it is just less typing.