I've recently switched from
JSF 1.1 to JSF 1.2 and am running into some apparent differences in the implementation of the convertDateTime component.
Here is the code snipit from the
jsp:
<t:inputText binding="#{reportMgrBean.timeUpStartDateInput}" size="10" maxlength="10"
immediate="true" value="#{reportMgrBean.timeUpStartDate}" title="yyyy-MM-dd"
forceId="true" id="timeUpStartDateInput">
<f:convertDateTime type="date" pattern="yyyy-MM-dd"/>
</t:inputText>
<t:inputText binding="#{reportMgrBean.timeUpStartTimeInput}" size="8" maxlength="8"
immediate="true" value="#{reportMgrBean.timeUpStartTime}" title="HH:mm:ss"
forceId="true" id="timeUpStartTimeInput">
<f:convertDateTime type="time" pattern="HH:mm:ss"/>
</t:inputText>
I have the appropriate backing bean ReportMgrBean with the associated HtmlInput binding objects.
When I submit the page, I see different values for the date and time depending on which JSF version I'm using.
The date and time fields are set in the bean using the same java.util.Date instance as follows:
Calendar c = Calendar.getInstance( TimeZone.getTimeZone( "GMT" ) );
startDateInput.setValue( c.getTime() );
startTimeInput.setValue( c.getTime() );
Under MyFaces 1.1.4,
Java 1.4, tomahawk 1.1.3 and assuming the date was 12:20:32 on Aug 4th 2009, I get:
date = '2009-08-04 00:00:00'
time= '1970-01-01 12:20:32'
So if I combine the two values, I end up with '2009-08-04 12:20:32', which is the correct submit date/time.
Under MyFaces 1.2.6, Java 1.5, tomahawk12-1.1.8, and assuming the same date/time values are set, I get:
date= '2009-08-04 12:20:32'
time= '1970-01-01 12:20:32'
So for some reason the converter on the "date" part is no longer zero-ing out the time fields, but the "time" converter IS zero-ing out the date fields. Can anyone else verify or have any ideas as to why this might be happening?
TIA.