UILayout.getLayout(component).encodeChildrenOfComponent(facesContext, component);
// RenderUtil.encodeChildren(facesContext, page);
// render popups into buffer
StringWriter popups = new StringWriter();
contentWriter = writer.cloneWithWriter(popups);
facesContext.setResponseWriter(contentWriter);
// write popup components
// beware of ConcurrentModificationException in cascating popups!
for (int i = 0; i < page.getPopups().size(); i++) {