1 Reply Latest reply on May 29, 2012 4:19 AM by Mahesh Bonagiri

    rich:calendar gives ConverterException

    msansm1 Newbie

      Hello,

       

      I generate a rich:calendar in java, then I use it in a form. When I try to save my form, I always have this exception :

      2012-05-16 09:28:44,102 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http-192.168.140.190-8080-6) Error Rendering View[/templates/jobform.xhtml]:
       javax.faces.convert.ConverterException: j_idt222:date_207Â : 'Tue May 15 00:00:00 CEST 2012' na pas pu être interprété en tant que date.
              at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:403) [:2.0.3-]
              at org.richfaces.utils.CalendarHelper.convertStringToDate(CalendarHelper.java:202) [:4.2.0.Final]
              at org.richfaces.utils.CalendarHelper.getAsDate(CalendarHelper.java:68) [:4.2.0.Final]
              at org.richfaces.renderkit.CalendarRendererBase.getSelectedDate(CalendarRendererBase.java:237) [:4.2.0.Final]
              at org.richfaces.renderkit.html.CalendarRenderer.encodeEnd(CalendarRenderer.java:543) [:4.2.0.Final]
              at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879) [:2.0.3-]
      

       

       

      The UICalendar generation :

       

      UICalendar input= (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);
      input.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{jobForm.fieldDef['"+id+"']}", String.class));
      input.setValueExpression("onchange", expressionFactory.createValueExpression(elContext, "fed();", Object.class));
      input.setId("date_"+id);
      input.setRequired(isMandatory);
      input.setPopup(true);
      input.setShowApplyButton(true);
      input.setDatePattern("dd/MM/yyyy");
      

       

      I tried few things, but evry time I get this error.

      If anyone has an idea, thanks.