facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
box.getFacets().put(Facets.LAYOUT, layout);
layout.getAttributes().put(Attributes.ROWS, "*;auto");
layout.getAttributes().put(Attributes.MARGIN, Measure.valueOf(10));
final UICell scrollPanel = (UICell)
CreateComponentUtils.createComponent(facesContext, UICell.COMPONENT_TYPE, "Cell", "messagePanel");
box.getChildren().add(scrollPanel);
messages.getParent().getChildren().remove(messages);
messages.setConfirmation(false);
scrollPanel.onComponentPopulated(facesContext, messages);
scrollPanel.setScrollbars("auto");
scrollPanel.getChildren().add(messages);
final UIComponent buttonPanel = CreateComponentUtils.createComponent(
facesContext, UIPanel.COMPONENT_TYPE, RendererTypes.PANEL, "buttonPanel");
layout = CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "buttonPanelLayout");
buttonPanel.getFacets().put(Facets.LAYOUT, layout);
layout.getAttributes().put(Attributes.COLUMNS, "*;100px");
layout.getAttributes().put(Attributes.ROWS, "auto");
box.getChildren().add(buttonPanel);
final UICell space = (UICell)
CreateComponentUtils.createComponent(facesContext, UICell.COMPONENT_TYPE, "Cell", "space");
buttonPanel.getChildren().add(space);
space.onComponentPopulated(facesContext, messages);
final UICommand okButton = (UICommand) CreateComponentUtils.createComponent(
facesContext, UIButton.COMPONENT_TYPE, RendererTypes.BUTTON, CLOSE_POPUP);
buttonPanel.getChildren().add(okButton);
okButtonAttributes = okButton.getAttributes();