I think Sven is right.
Debugging through, it appears to be here in ResourceAggregator:

        private void recordHeaderItem(HeaderItem item, Set<HeaderItem> depsDone)
        {
                renderDependencies(item, depsDone);
                RecordedHeaderItem recordedItem = itemsToBeRendered.get(item);

 “recordedItem” ends up as the old header item rather than the new one.

Bng


On 4/24/17, 6:09 PM, "Sven Meier" <[email protected]> wrote:

    HI,
    
    this might be caused by ResourceAggregator - it marks items as being 
    rendered, instead of render tokens.
    
    I'll check tomorrow.
    
    Sven
    
    
    On 24.04.2017 23:41, Martin Grigorov wrote:
    > On Mon, Apr 24, 2017 at 11:39 PM, Martin Grigorov <[email protected]>
    > wrote:
    >
    >> Hi,
    >>
    >> On Mon, Apr 24, 2017 at 10:20 PM, Boris Goldowsky <[email protected]>
    >> wrote:
    >>
    >>> I have a situation like this:
    >>>
    >>> public void renderHead(IHeaderResponse response) {
    >>>      …
    >>>      response.render(JavaScriptHeaderItem.forReference(resRef,
    >>> pageParameters1, “id1”));
    >>>      response.render(JavaScriptHeaderItem.forReference(resRef,
    >>> pageParameters2, “id2”));
    >>> }
    >>>
    >>> where same ResourceReference is used for both resources – the different
    >>> page parameters point it to different actual Resources.
    >>>
    >>> However, the check for uniqueness of header items seems to consider them
    >>> equal, despite the different PageParameters and different IDs, and only 
one
    >>> of them actually gets rendered in the page head.
    >>>
    >> Which check exactly do you refer ?
    >>
    >> org.apache.wicket.markup.head.internal.HeaderResponse#markItemRendered()
    >> does such check by calling org.apache.wicket.markup.head.HeaderItem#
    >> getRenderTokens().
    >> 
org.apache.wicket.markup.head.JavaScriptReferenceHeaderItem#getRenderTokens()
    >> uses the url and the id. The url contains the parameters.
    >> All looks good to me!
    >>
    > The other check is at jQuery.Head.containsElement() 
(wicket-ajax-jquery.js)
    > and it uses the value "src", i.e. it should not match because of the
    > different parameters.
    >
    >>
    >>> Is this a bug, or is there a way to force the two items to both be
    >>> included?
    >>>
    >>> I’m using Wicket 7.5.0.
    >>>
    >>> Boris
    >>>
    >>>
    >>>
    >>>
    >>>
    
    
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
    
    

Reply via email to