Specifying Converter for a Dynamic UI Component
The following code snippet illustrates the API usage for setting JSF converter for a UI component added at runtime. RichInputDate inputDate1 = new RichInputDate(); Application application= FacesContext.getCurrentInstance().getApplication(); DateTimeConverter dateTimeConverter= (DateTimeConverter) application.createConverter("javax.faces.DateTime"); dateTimeConverter.setPattern("yyyy dd mm"); inputDate1.setConverter(dateTimeConverter); Tag doc for af:inputDate says that - Developers can programmatically attach a converter. That converter should be obtained by Application.createConverter(), rather than simply calling new DateTimeConverter(). Otherwise, some functionality will be missing, e.g. client conversion and validation, and the date picker will only display as an input field without the date-time popup (the popup relies on the client conversion and validation support)