You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Christian Wellekötter (Issue Comment Edited JIRA)" <ji...@apache.org> on 2011/11/25 18:05:40 UTC

[jira] [Issue Comment Edited] (WICKET-4263) Missing renderCSSReference- and renderJavascriptReference-Methods in HeaderResponseContainerFilteringHeaderResponse (have to be overwritten from DecoratingHeaderResponse)

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

Christian Wellekötter edited comment on WICKET-4263 at 11/25/11 5:03 PM:
-------------------------------------------------------------------------

I am not familiar with providing a patch, but following methods are missing:

    @Override
    public void renderJavaScriptReference(final String url, final String id, final boolean defer) {
        forJavaScript(new Runnable() {
            public void run() {
                getRealResponse().renderJavaScriptReference(url, id, defer);
            }
        });
    }

    @Override
    public void renderJavaScriptReference(final String url, final String id, final boolean defer, final String charset) {
        forJavaScript(new Runnable() {
            public void run() {
                getRealResponse().renderJavaScriptReference(url, id, defer, charset);
            }
        });
    }


    @Override 
    public void renderCSSReference(final ResourceReference reference, final PageParameters pageParameters, final String media, final String condition) {
        forReference(reference, new Runnable(){
			public void run()
			{
				getRealResponse().renderCSSReference(reference, pageParameters, media, condition);
            }
        });
    }

    @Override 
    public void renderCSSReference(final String url, final String media, final String condition) {
        forCss(new Runnable(){
            public void run() {
                getRealResponse().renderCSSReference(url, media, condition);
            }
        });
    }

    @Override 
    public void renderCSS(final CharSequence css, final String id) {
        forCss(new Runnable(){
            public void run() {
                getRealResponse().renderCSS(css, id);
            }
        });
    }



                
      was (Author: cwellekoetter):
    I am not familiar with providing a patch, but following methods are missing:

{code}

    @Override
    public void renderJavaScriptReference(final String url, final String id, final boolean defer) {
        forJavaScript(new Runnable() {
            public void run() {
                getRealResponse().renderJavaScriptReference(url, id, defer);
            }
        });
    }

    @Override
    public void renderJavaScriptReference(final String url, final String id, final boolean defer, final String charset) {
        forJavaScript(new Runnable() {
            public void run() {
                getRealResponse().renderJavaScriptReference(url, id, defer, charset);
            }
        });
    }


    @Override 
    public void renderCSSReference(final ResourceReference reference, final PageParameters pageParameters, final String media, final String condition) {
        forReference(reference, new Runnable(){
			public void run()
			{
				getRealResponse().renderCSSReference(reference, pageParameters, media, condition);
            }
        });
    }

    @Override 
    public void renderCSSReference(final String url, final String media, final String condition) {
        forCss(new Runnable(){
            public void run() {
                getRealResponse().renderCSSReference(url, media, condition);
            }
        });
    }

    @Override 
    public void renderCSS(final CharSequence css, final String id) {
        forCss(new Runnable(){
            public void run() {
                getRealResponse().renderCSS(css, id);
            }
        });
    }

{code}

                  
> Missing renderCSSReference- and renderJavascriptReference-Methods in HeaderResponseContainerFilteringHeaderResponse (have to be overwritten from DecoratingHeaderResponse)
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4263
>                 URL: https://issues.apache.org/jira/browse/WICKET-4263
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>            Reporter: Christian Wellekötter
>              Labels: wicket
>
> A AbstractDependencyRespectingResourceAggregatingHeaderResponse cannot be used in addition to a because the css and javascript is rendered by the "render" method of the HeaderResponseContainerFilteringHeaderResponse:
> 	/**
> 	 * Renders a single resource reference. This is called from
> 	 * {@link #renderIfNotAlreadyRendered(Set, ResourceReferenceAndStringData)} for references that
> 	 * had not been rendered elsewhere.
> 	 * 
> 	 * @param data
> 	 *            the reference (and associated data) to conditionally render.
> 	 */
> 	protected void render(ResourceReferenceAndStringData data)
> 	{
> 		ResourceUtil.renderTo(getRealResponse(), data);
> 	}
> If you take al look into the ResourceUtil.renderTo Method, you will see that the used "renderCSSReference"- and "renderJavascriptReference"-methods are not overwritten in the HeaderResponseContainerFilteringHeaderResponse class.
> So a filtering of javascript and css References in different buckets is not possible, if you additionally would like to aggregate the css and javascript references in different groups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira