Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
new AbstractHeaderContributor() {

            @Override
            public void renderHead(IHeaderResponse response) {
                //your logic goes here
            }
        };

Component and IBehavior implement IHeaderContributor

Prior to 1.5 IHeaderContributor was used as a mixin for components and behaviors that wanted to write to the header, in 1.5 it is no longer necessary to implement the interface directly because both Component and IBehavior implement it.

Removed HeaderContributor and friends.

HeaderContributor was a convenience that did not add much and actually made things worth by increasing memory footprint in a lot of cases. Instead we can simply override IHeaderContributor#renderHead(IHeaderResponse) and achieve the same functionality in a simpler and consistent fashion.

Wicket 1.4:

Code Block
public class MyPage extends WebPage {
  public MyPage() {
    add(HeaderContributor.forJavaScript(YuiLib.class, "yahoo-dom-event/yahoo-dom-event.js"));
    add(HeaderContributor.forCss(AbstractCalendar.class, "assets/skins/sam/calendar.css"));
  }
}

...