picker.setImmediate(true);
final String linkId = picker.getId();
// create popup
final String popupId = linkId != null ? linkId + "popup" : facesContext.getViewRoot().createUniqueId();
final UIPopup popup = (UIPopup) CreateComponentUtils.createComponent(
facesContext, UIPopup.COMPONENT_TYPE, RendererTypes.POPUP, popupId);
popup.getAttributes().put(Attributes.Z_INDEX, 10);
picker.getFacets().put(Facets.PICKER_POPUP, popup);
popup.setRendered(false);
popup.onComponentPopulated(facesContext, parent);
final UIBox box = (UIBox) CreateComponentUtils.createComponent(
facesContext, UIBox.COMPONENT_TYPE, RendererTypes.BOX, "box");
popup.getChildren().add(box);
// TODO: set string resources in renderer
box.setLabel(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "datePickerTitle"));
final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
box.getFacets().put(Facets.LAYOUT, layoutOfBox);