Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-1425

Support to java.sql.Date using inputCalendar tag.

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.8
    • Fix Version/s: 1.1.10
    • Component/s: Calendar
    • Labels:
      None

      Description

      Trying to use a java.sql.Date value for inputCalendar results in IllegalArgumentException, thrown by the deprecated method getHour of java.sql.Date.
      java.util.Date does not throw any exceptions when getHour is invoked.

      1. HtmlCalendarRenderer.java.patch
        0.8 kB
        Paulo Henrique Couto de Lima

        Issue Links

          Activity

          Hide
          henrique.couto Paulo Henrique Couto de Lima added a comment -

          Patch

          Show
          henrique.couto Paulo Henrique Couto de Lima added a comment - Patch
          Hide
          henrique.couto Paulo Henrique Couto de Lima added a comment -

          Aply the provided patch.

          Show
          henrique.couto Paulo Henrique Couto de Lima added a comment - Aply the provided patch.
          Hide
          henrique.couto Paulo Henrique Couto de Lima added a comment -

          The patch was created and submited.

          Show
          henrique.couto Paulo Henrique Couto de Lima added a comment - The patch was created and submited.
          Hide
          mitchaoc Andrew Mitchell added a comment -

          How can this issue be resolved in the same version it was fixed in? It's NOT resolved in 1.1.8 - the patch needs to be applied to the next release.

          Show
          mitchaoc Andrew Mitchell added a comment - How can this issue be resolved in the same version it was fixed in? It's NOT resolved in 1.1.8 - the patch needs to be applied to the next release.
          Hide
          lu4242 Leonardo Uribe added a comment -

          It is true, this patch was never applied. It seems this one was closed silently.

          Show
          lu4242 Leonardo Uribe added a comment - It is true, this patch was never applied. It seems this one was closed silently.
          Hide
          lu4242 Leonardo Uribe added a comment -

          I committed an alternative solution. When it is called SimpleDateFormatter.format(Date) or SimpleDateFormatter.getWeekDate(Date), we just check if the date instance is java.sql.Date and we replace it with java.util.Date for the scope of the method.

          Show
          lu4242 Leonardo Uribe added a comment - I committed an alternative solution. When it is called SimpleDateFormatter.format(Date) or SimpleDateFormatter.getWeekDate(Date), we just check if the date instance is java.sql.Date and we replace it with java.util.Date for the scope of the method.
          Hide
          mmarinschek Martin Marinschek added a comment -

          Hi Leonardo,

          I have always thought that JSF should add a business-converter for such issues. So we should have a way to convert between the model type that we need for the renderer, and the model-type that the backing-beans use.

          You could register such a converter on the input-component like the normal converter, businessConverter="...". We could also cover stuff like the joda-date with this.

          Eventually, we could even add a central registry for this in MyFaces where you can register business-converters centrally and hence let the renderer automatically retrieve such a a converter for the backing-bean datatype and the datatype it needs.

          best regards,

          Martin

          Show
          mmarinschek Martin Marinschek added a comment - Hi Leonardo, I have always thought that JSF should add a business-converter for such issues. So we should have a way to convert between the model type that we need for the renderer, and the model-type that the backing-beans use. You could register such a converter on the input-component like the normal converter, businessConverter="...". We could also cover stuff like the joda-date with this. Eventually, we could even add a central registry for this in MyFaces where you can register business-converters centrally and hence let the renderer automatically retrieve such a a converter for the backing-bean datatype and the datatype it needs. best regards, Martin
          Hide
          lu4242 Leonardo Uribe added a comment -

          I created TOMAHAWK-1508 to deal with this idea there

          Show
          lu4242 Leonardo Uribe added a comment - I created TOMAHAWK-1508 to deal with this idea there

            People

            • Assignee:
              lu4242 Leonardo Uribe
              Reporter:
              henrique.couto Paulo Henrique Couto de Lima
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development