}
@Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
UIDatePicker picker = (UIDatePicker) component;
UIDate dateInput = (UIDate) picker.getForComponent();
if (dateInput == null) {
LOG.error("The required UIDate component wasn't found for component id='" + component.getId());
return;
}
// this can't be done in "onComponentPopulated()" of the picker, it seems to be to early
if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.READONLY)) {
FacesUtils.copyValueBindingOrValueExpression(dateInput, Attributes.READONLY, picker, Attributes.DISABLED);
} else {
if (FacesUtils.hasValueBindingOrValueExpression(dateInput, Attributes.DISABLED)) {
FacesUtils.copyValueBindingOrValueExpression(dateInput, Attributes.DISABLED, picker, Attributes.DISABLED);
} else {
picker.setDisabled(dateInput.isReadonly() || dateInput.isDisabled());
}
}
Map<String, Object> attributes = picker.getAttributes();
UIPopup popup = (UIPopup) picker.getFacets().get(Facets.PICKER_POPUP);