Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
public class MyPage extends WebPage {
...

    @Override
    public void renderHead(HtmlHeaderContainerIHeaderResponse containerresponse) {
        container.getHeaderResponse().renderOnLoadJavascript("alert('test')")super.renderHead(response);
    response.renderJavascriptReference(new    super.renderHead(containerJavascriptResourceReference(MyPage.class, "script.js"));
    }
}
...

Also see the example for Wicket 1.5.

Wicket 1.5

In Wicket 1.5, CompressedResourceReference has been removed!

Also, the getHeaderContribution functionality has been removed. Instead, your component (Page, Panel, etc.) needs to override renderHead(IHeaderResponse):

Code Block

public class MyPage extends WebPage implements IHeaderContributor {
...
  @Override
  public void renderHead(IHeaderResponse response) {
    response.renderJavaScriptReference("urlHere");
  }

...