}
final String clientId = popup.getClientId(facesContext);
// XXX May be computed in the "Layout Manager Phase"
AbstractUIPage page = ComponentUtils.findPage(facesContext);
if (popup.getLeft() == null) {
popup.setLeft(page.getCurrentWidth().subtract(popup.getCurrentWidth()).divide(2));
}
if (popup.getTop() == null) {
popup.setTop(page.getCurrentHeight().subtract(popup.getCurrentHeight()).divide(2));
}
writer.startElement(HtmlElements.DIV, popup);
writer.writeIdAttribute(clientId);
HtmlRendererUtils.writeDataAttributes(facesContext, writer, popup);