use of org.apache.wicket.markup.renderStrategy.IHeaderRenderStrategy in project wicket by apache.
the class PartialPageUpdate method writeHeaderContribution.
/**
* @param response
* the response to write to
* @param component
* to component which will contribute to the header
*/
protected void writeHeaderContribution(final Response response, final Component component) {
headerRendering = true;
// create the htmlheadercontainer if needed
if (header == null) {
header = new PartialHtmlHeaderContainer(this);
page.addOrReplace(header);
}
RequestCycle requestCycle = component.getRequestCycle();
// save old response, set new
Response oldResponse = requestCycle.setResponse(headerBuffer);
try {
headerBuffer.reset();
IHeaderRenderStrategy strategy = AbstractHeaderRenderStrategy.get();
strategy.renderHeader(header, null, component);
} finally {
// revert to old response
requestCycle.setResponse(oldResponse);
}
writeHeaderContribution(response);
headerRendering = false;
}
Aggregations