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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Patch Available Patch Available Open Open
          1m 25s 1 Paulo Henrique Couto de Lima 29/May/09 15:06
          Open Open Patch Available Patch Available
          2m 4s 2 Paulo Henrique Couto de Lima 29/May/09 15:07
          Patch Available Patch Available Resolved Resolved
          1h 22m 1 Paulo Henrique Couto de Lima 29/May/09 16:29
          Closed Closed Reopened Reopened
          95d 3h 15m 1 Leonardo Uribe 01/Sep/09 19:46
          Reopened Reopened Resolved Resolved
          242d 6h 16m 1 Leonardo Uribe 02/May/10 02:02
          Resolved Resolved Closed Closed
          148d 20h 34m 2 Leonardo Uribe 27/Sep/10 22:36
          Leonardo Uribe made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Leonardo Uribe made changes -
          Fix Version/s 1.1.10 [ 12315371 ]
          Fix Version/s 1.1.10-SNAPSHOT [ 12314036 ]
          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
          Leonardo Uribe made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Assignee Leonardo Uribe [ lu4242 ]
          Fix Version/s 1.1.10-SNAPSHOT [ 12314036 ]
          Resolution Fixed [ 1 ]
          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.
          Leonardo Uribe made changes -
          Link This issue is duplicated by TOMAHAWK-1434 [ TOMAHAWK-1434 ]
          Leonardo Uribe made changes -
          Fix Version/s 1.1.8 [ 12313507 ]
          Leonardo Uribe made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          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.
          Paulo Henrique Couto de Lima made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          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.
          Paulo Henrique Couto de Lima made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s 1.1.8 [ 12313507 ]
          Resolution Fixed [ 1 ]
          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.
          Paulo Henrique Couto de Lima made changes -
          Attachment HtmlCalendarRenderer.java.patch [ 12409392 ]
          Hide
          Paulo Henrique Couto de Lima added a comment -

          Patch

          Show
          Paulo Henrique Couto de Lima added a comment - Patch
          Paulo Henrique Couto de Lima made changes -
          Original Estimate 5m [ 300 ] 1h [ 3600 ]
          Remaining Estimate 5m [ 300 ] 1h [ 3600 ]
          Paulo Henrique Couto de Lima made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Paulo Henrique Couto de Lima made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Paulo Henrique Couto de Lima made changes -
          Field Original Value New Value
          Status Open [ 1 ] Patch Available [ 10002 ]
          Paulo Henrique Couto de Lima created issue -

            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