TypeConversionException when using af:validateDateTimeRange

ADF Faces provides the af:validateDateTimeRange tag in the Operations category of the Component Palette for applications to enforce valid date and time ranges.

However adding the af:validateDateTimeRange to an ADF Business Components bound date field may cause a type conversion exception at runtime as shown below:

<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase PROCESS_VALIDATIONS 3
org.apache.myfaces.trinidadinternal.convert.TypeConversionException: Could not convert instance:2011-05-17 of type:class java.lang.String into type:class java.util.Date
at org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory.convert (GenericConverterFactory.java:289)
at org.apache.myfaces.trinidadinternal.validator.DateTimeRangeValidator. validate(DateTimeRangeValidator.java:63
)

The exception is thrown when a user updates the date field and submits the form. The reason for this exception is that the date field in ADF Business Components has a simple date format configured in its UI Control hints. To avoid this error, you need to unset the simple date format configuration on the View Object or Entity Object.

The UI Control hint is not automatically set when creating ADF Business Components models, which helps to control the setting of simple date patterns to date fields that don't require enforcing a specific date and time range

Comments:

Post a Comment:
Comments are closed for this entry.
About

The Oracle JDeveloper forum ranks in the Top 5 of the most active forums on the Oracle Technology Network (OTN).



The OTN Harvest blog is a summary of selected topics posted on the OTN Oracle JDeveloper forum.



It is an effort to turn knowledge exchange into an interesting read for developers who enjoy little nuggets of wisdom





Frank Nimphius

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today