title: Wicket manipulate javascript import order
body: <p>I'm trying to use the very nice ConfirmerAjaxLink from <a href="http://wicket.visural.net/examples/confirmers?0" rel="nofollow">Visural</a>. However, I'm getting a js script when loading the page: 'jQuery is not defined'. </p>
  
  <p>I wrote a little test page to identify the problem:</p>
  
  <pre><code>public class ConfirmAjaxLinkTestPage extends WebPage {
  
  public ConfirmAjaxLinkTestPage() {
      this.add(new ConfirmerAjaxLink("confirm") {
  
          @Override
          public void onClick(AjaxRequestTarget target) {
              System.out.println("OK");
          }
      });
  }
  
  @Override
  public void renderHead(IHeaderResponse response) {
      response.renderJavaScriptReference(new JavaScriptResourceReference(
              JavascriptLibraryUtil.class,
              "jquery/jquery-1.6.1.min.js"));
  }
  }
  </code></pre>
  
  <p>After a quick search I saw that the ConfirmerAjaxLink will add another javascript that uses jQuery. However, since this is done through a behavior that is added to the component (above link) this script gets added to the markup before the jQuery one (since this is called before the renderHead of my page).</p>
  
  <p>If I change the headerRenderStrategy to parent first like this:</p>
  
  <pre><code>System.setProperty("Wicket_HeaderRenderStrategy","org.apache.wicket.markup.renderStrategy.ParentFirstHeaderRenderStrategy");
  </code></pre>
  
  <p>it works but this is more a hack than a solution (also, as stated in in <code>AbstractHeaderRenderStrategy</code>:NOT OFFICIALLY SUPPORTED BY WICKET).</p>
  
  <p>Is there a clean way to this (I would think not exceptional) problem? </p>