MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1425

Support to java.sql.Date using inputCalendar tag.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor 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
          Leonardo Uribe added a comment -

          I created TOMAHAWK-1508 to deal with this idea there

          Show
          Leonardo Uribe added a comment - I created TOMAHAWK-1508 to deal with this idea there
          Hide
          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
          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
          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
          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
          Leonardo Uribe added a comment -

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

          Show
          Leonardo Uribe added a comment - It is true, this patch was never applied. It seems this one was closed silently.
          Hide
          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
          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
          Paulo Henrique Couto de Lima added a comment -

          The patch was created and submited.

          Show
          Paulo Henrique Couto de Lima added a comment - The patch was created and submited.
          Hide
          Paulo Henrique Couto de Lima added a comment -

          Aply the provided patch.

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

          Patch

          Show
          Paulo Henrique Couto de Lima added a comment - Patch

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              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