Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-8173

Regression: Calendar: converter is not working

    Details

      Description

      I have a model property with is a Joda LocalDate. For normal input fields, I have a converter, which is working fine. However, when I try to use the converter with rich:calendar, it complains:

      <rich:calendar id="from" locale="AU" showApplyButton="false" popup="true"
      enableManualInput="true" datePattern="dd/MM/yyyy"
      value="#

      {adviserAvailability.validFrom}

      ">
      <f:converter converterId="localDateConverter" />
      </rich:calendar>

      javax.faces.convert.ConverterException: Value must be a date
      at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:401)
      at org.richfaces.component.UICalendar.getAsDate(UICalendar.java:399)
      at org.richfaces.component.UICalendar.getAsDate(UICalendar.java:410)
      at org.richfaces.component.UICalendar.getCurrentDateOrDefault(UICalendar.java:374)
      at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:381)
      at org.richfaces.renderkit.html.CalendarRenderer.doEncodeEnd(CalendarRenderer.java:531)
      at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
      ...

      I'm defining the converter as such:

      @Name( "localDateConverter" )
      @BypassInterceptors
      @Converter( forClass = LocalDate.class, id = "localDateConverter")
      public class LocalDateConverter
      implements javax.faces.convert.Converter {
      public Object getAsObject( ... )

      { .... }
      public String getAsString( ... ) { .... }

      }

      If I turn the property into a Date by using: value="#

      {adviserAvailability.validFrom.toDateMidnight().toDate()}

      "
      I get a conversion error, as I would expect from with LocalDateConverter.getAsObject, so it's definitely being made available.

      I get the same issue regardless of if I use <f:converter> or the converter attribute of <rich:calendar>

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Alex.Kolonitsky Alex Kolonitsky
                  Reporter:
                  joff Joseph Miller
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: