Hello,
I have the following problem with dateChooser. I have element
<ig:dateChooser value="#{iterationController.iteration.plannedEffectivityStart}" converter="shortDateConverter"></ig:dateChooser>
where I use "converter" attribute. I have defined and implemented converter. First definition in faces-config.xml:
<converter>
<converter-id>shortDateConverter</converter-id>
<converter-class>com.anect.rmt.web.converters.ShortDateConverter</converter-class>
</converter>
ShortDateConverter implements Converter interface:
public Object getAsObject(FacesContext context, UIComponent comp, String date) {
...
public String getAsString(FacesContext context, UIComponent comp, Object date) {
}
When I want render the page, I see exception:
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1496)
at com.infragistics.faces.input.taglib.html.DateChooserTag.setProperties(DateChooserTag.java:303)
I use JSF 2008.2 version. Thanks.
ANECT
Hi,
Could you please provide me with some more details, i.g. how the converters are implemented etc.
Regards!
Converter implementation:
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
public class ShortDateConverter implements Converter {
if (StringUtils.isEmpty(date)) {
Locale l = FacesContext.getCurrentInstance().getViewRoot().getLocale();
return (Object) df.parse(date);
I think, it is clear, I don't see there any possible problem. Only easy converter, that converts data for dateChooser and back. Do you want see whole stack trace? Thanks.
Unfortunatelly I could not reproduce your problem. But using our DateChooser you can set an Edit Mask for the way in that dates are displayed, i.g.
In the other direction the DateChooser will care for converting the entered date into a Date object.
so could I ask you for a simple example of dateChooser converter attribute? I didn't find any usage of converter attribute (and it is attribute defined nearly for all input elements) in your official samples. Use of editMasks attribute is fine, but it is not solution for internationalization (when I need different masks for different languages). Using JSF converter is clear solution of that. Thanks.
com.infragistics.faces.input.converter.DateTimeConverter class.
We shpuld expect this behaviour later.
Best Regards, Nina
Sorry for my error. Read the statement "We shpuld expect this behaviour later." as "We should inspect this behaviour later."