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

Chris Colman commented on WICKET-4408:
--------------------------------------

Could this work if, instead of outputting header and body into a single output 
stream, Wicket rendered header and body into two separate streams that are then 
combined into the final page output stream only after the body has been 
completely rendered?

That would allow contributions to the header to continue to occur during 
rendering of the body, rather than forcing closing off of header rendering as 
soon as body rendering starts.

To avoid dealing with two separate streams this idea could be optimized so that 
the header output stream remains as the current  output stream but body output 
goes to a separate stream, only when the body is completely rendered is its 
output stream buffer then appended to the header (current) output stream.

It seems limiting that components rendered by IComponentResolverS are treated 
as second class citizens (components) and are effectively disabled in many 
areas of functionality.
                
> Components resolved by an IComponentResolver fail to contribute to header via 
> renderHead
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-4408
>                 URL: https://issues.apache.org/jira/browse/WICKET-4408
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4
>         Environment: Happens on all FireFox  Chrome, IE
> Windows XP
>            Reporter: Chris Colman
>            Assignee: Igor Vaynberg
>              Labels: wicket
>
> If a component is resolved via an IComponentResolver implementation then its 
> overridden renderHead method never gets called.
> If the same component is added explicitly to its parent then its renderHead 
> method is called.
> This is critical for us because we have markup variations that may or may not 
> include certain panels. We thus leave the construction/adding of these panels 
> to our IComponentResolver implementation because we can't explicitly add them 
> because not all markup will require all panels.
> Class MyPanel extends Panel
> {
> /**
>  * Write out necessary header markup.
>  */
> @Override
> public void renderHead(IHeaderResponse response)
> {
>     StringBuffer sb = new StringBuffer();
>     
>     sb.append("<script src=\"/jquery.easing.1.3.min.js\"></script>");
>     sb.append("<script src=\"/trans-banner.min.js\"></script>");
>  
>     response.renderString(sb.toString());
> } 
> }
> We aren't using any markup inheritance at the panel level.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to