1 Reply Latest reply on Mar 9, 2011 6:24 AM by Ilya Shaikovsky

    RF 4 CR1: @NotNull and rich:calendar

    Jesper Vrelits Newbie

      Some problems with rich:calendar in RF 4 CR1

       

      If I use java.util.Date I get:

       

      org.richfaces.component.behavior.ConverterNotFoundException: No converter registered for type java.util.Date
      at org.richfaces.component.behavior.ClientValidatorImpl.createConverterByType(ClientValidatorImpl.java:264)
      at org.richfaces.component.behavior.ClientValidatorImpl.getConverter(ClientValidatorImpl.java:243)
      at org.richfaces.renderkit.html.ClientValidatorRenderer.createValidatorScript(ClientValidatorRenderer.java:148)
      at org.richfaces.renderkit.html.ClientValidatorRenderer.buildAndStoreValidatorScript(ClientValidatorRenderer.java:131)
      at org.richfaces.renderkit.html.ClientValidatorRenderer.getScript(ClientValidatorRenderer.java:64)

       

      If I use Calendar I get:

       

      javax.faces.convert.ConverterException: j_idt29:from: Could not convert 'java.util.GregorianCalendar[time=1298375361004,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Paris",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=184,lastRule=java.util.SimpleTimeZone[id=Europe/Paris,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2011,MONTH=1,WEEK_OF_YEAR=8,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=53,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=49,SECOND=21,MILLISECOND=4,ZONE_OFFSET=3600000,DST_OFFSET=0]' to a string.
      at javax.faces.convert.DateTimeConverter.getAsString(DateTimeConverter.java:469)

       

      If i use the TIME part of Calendar {calendar.time} it works but then when I put rich:validator and @NotNull on the field I get a NPE.

       

      So I'm not able to use JSR 303 @NotNull and Date/Calendar field with rich:calendar and rich:validator.

       

      Am I totally missing something?? What is the supported way to have a date field with @NotNull????