String id = messages.getId() != null ? messages.getId() + "popup" : facesContext.getViewRoot().createUniqueId();
final UIPopup popup = (UIPopup)
CreateComponentUtils.createComponent(facesContext, UIPopup.COMPONENT_TYPE, RendererTypes.POPUP, id);
popup.getAttributes().put(Attributes.Z_INDEX, 10);
AbstractUIPage page = ComponentUtils.findPage(facesContext, messages);
popup.setWidth(page.getCurrentWidth().subtract(200));
popup.setHeight(page.getCurrentHeight().subtract(200));
popup.setLeft(Measure.valueOf(100));
popup.setTop(Measure.valueOf(100));
popup.setRendered(true);
popup.setActivated(true);
((TobagoFacesContext) facesContext).getPopups().add(popup);