[ 
https://issues.apache.org/jira/browse/WICKET-6617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16706911#comment-16706911
 ] 

ASF GitHub Bot commented on WICKET-6617:
----------------------------------------

Github user svenmeier commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/343#discussion_r238201851
  
    --- Diff: 
wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js 
---
    @@ -2116,10 +2116,15 @@
     
                        // Adds the element to page head
                        addElement: function (element) {
    -                           var head = 
document.getElementsByTagName("head");
    +                           var headItems = document.querySelector('head 
meta[name="wicket.header.items"]');
    --- End diff --
    
    Seems we haven't used querySelector() before - are we increasing the 
minimum supported browser version with this?


> Header contribution ignore <wicket:header-items/>
> -------------------------------------------------
>
>                 Key: WICKET-6617
>                 URL: https://issues.apache.org/jira/browse/WICKET-6617
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 8.2.0
>            Reporter: Maxim Solodovnik
>            Assignee: Maxim Solodovnik
>            Priority: Major
>
> 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:
> {code}
> <html>
>   <head>
>     <wicket:header-items/>
>     <title>Hello</title>
>   </head>
>   <body>
>       ........
>   </body>
> <html>
> {code}
> In your java code you replacing component A with component B on the page via 
> AJAX
> Component B contributing to {{<head>}} as follows:
> {code}
>       @Override
>       public void renderHead(IHeaderResponse response) {
>               super.renderHead(response);
>               response.render(JavaScriptHeaderItem.forReference(new 
> JavaScriptResourceReference(B.class, "some.js")));
>       }
> {code}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to