Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6617

Header contribution ignore <wicket:header-items/>

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.2.0
    • Fix Version/s: 8.3.0, 9.0.0-M1
    • Component/s: wicket-core
    • Labels:
      None

      Description

      Components added via AJAX and contributing to <head> using @Override renderHead ignores <wicket:header-items/> if any

      Here is the example:
      Imaging you have following markup:

      <html>
        <head>
          <wicket:header-items/>
          <title>Hello</title>
        </head>
        <body>
            ........
        </body>
      <html>
      

      In your java code you replacing component A with component B on the page via AJAX
      Component B contributing to <head> as follows:

      	@Override
      	public void renderHead(IHeaderResponse response) {
      		super.renderHead(response);
      		response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(B.class, "some.js")));
      	}
      

      As developer I would expect additional JS/CSS files (or any other header resources) will be appended before <title> tag since I have placed <wicket:header-items/> tag

      Currently only initial header resources will take <wicket:header-items/> into account

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                solomax Maxim Solodovnik
                Reporter:
                solomax Maxim Solodovnik
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: