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

Header contribution ignore <wicket:header-items/>

Attach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 8.2.0
    • 8.3.0, 9.0.0-M1
    • wicket-core
    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            solomax Maxim Solodovnik
            solomax Maxim Solodovnik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment