I have a JSF composite component TimePicker.xhtmlwith a base component timePickerComponentthat is used below:
<mi:timePicker style="display: initial;"
widgetVar="toTimepickerWidget"
converter="#{timePickerConverter}"
value="#{calendarBean.event.to}"
/>
And timePickerConverteris created in the usual way:
public class TimePickerConverter implements Converter, Serializable {
@Override
public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
throws ConverterException {
return null;
}
@Override
public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2)
throws ConverterException {
return null;
}
}
How to use this converter in a composite component?
UPDATE:
This is the component code:
<cc:implementation componentType="timePickerComponent">
<h:outputScript name="js/timepicker/timepicker_helper.js" target="head"/>
<div id="#{cc.clientId}" style="#{cc.attrs.style}">
<p:inputText id="timepicker"
scrollHeight="200"
value="#{cc.timeLocal}"
size="5"/>
</div>
</cc:implementation>
Basically I want to convert plain text from inputTextto Datean object. The part date does not matter to me, I only need the part time of the object. Btw, as a workaround, I will use getConvertedValue, as described in this article, from BalusC A component component with several input fields But I would like to know how to delegate this function to an external converter, as described in the article
, JSF-