private Element createPopupFromType(final PopupType popupTypeParam, final String id) {
Screen screen = getCurrentScreen();
LayoutPart layerLayout = rootLayerFactory.createRootLayerLayoutPart(this);
PopupType popupType = new PopupType(popupTypeParam);
popupType.prepare(this, screen, screen.getRootElement().getElementType());
Element element = popupType.create(screen.getRootElement(), this, screen, layerLayout);
element.setId(id);
fixupSubIds(element, id);
if (screen.isBound()) {
element.layoutElements();
element.bindControls(screen);