And I clicked Star on the issue that you created, so i will be informed of updates on that issue in issue tracker.
Earlier, I wanted to say, that I 'learned' long time ago to NOT use p:calendar for date 'and' time.
I use p:calendar for DATE and (PrimeFaces Extension) pe:timePicker for TIME. Maybe 1 year ago (or less/more), I went throughout my app and made sure p:calendar for DATE and pe:timePicker for TIME. I think I recognized this bug back then, and I needed/wanted p:ajax after enduser select DATE and TIME, so using 2 different components with their own p:ajax...fixed the issue for me.
So, in my app, I have the following:
for non-mobile devices
Code: Select all
<h:panelGrid columns="3" cellpadding="1" cellspacing="1">
<h:outputText value="Trip Date/Time:" />
<p:calendar id="tripDate" value="#{pf_ordersController.tripDate[0]}"
mode="popup" showOn="focus"
pattern="MM/dd/yyyy" navigator="true"
size="10" label="Trip Date">
<f:convertDateTime pattern="MM/dd/yyyy" />
<p:ajax partialSubmit="false" event="dateSelect"
listener="#{pf_ordersController.tripDateSelectedOnAddEdit}"
update="@(.ui-panel) :orderEditForm:reportDate :orderEditForm:reportTime :orderEditForm:returnDate :orderEditForm:returnTime :orderEditForm:formMessages :orderEditForm:_ajax_status"/>
<p:ajax partialSubmit="false"
update="@(.ui-panel) :orderEditForm:formMessages :orderEditForm:_ajax_status"
listener="#{pf_ordersController.tripDateChangedOnAddEdit}"/>
</p:calendar>
<pe:timePicker id="tripTime" value="#{pf_ordersController.tripTime[0]}"
label="Trip Time" mode="popup" showPeriod="true"
style="width: 80px;">
<f:convertDateTime pattern="hh:mm a" />
</pe:timePicker>
</h:panelGrid>
for mobile devices via HTML5 type="date" and type="time" (which opens dialog on mobile device...smile)
Code: Select all
<h:panelGrid columns="2" cellpadding="1" cellspacing="1">
<h:outputText value="Trip Date:" />
<p:inputText id="tripDateOnMobile"
value="#{pf_ordersController.tripDate[0]}"
label="Trip Date" type="date">
<f:convertDateTime pattern="yyyy-MM-dd" />
<p:ajax partialSubmit="false"
update="@(.ui-panel) :orderEditForm:reportDateOnMobile :orderEditForm:reportTimeOnMobile :orderEditForm:returnDateOnMobile :orderEditForm:returnTimeOnMobile :orderEditForm:formMessages :orderEditForm:_ajax_status"
listener="#{pf_ordersController.tripDateChangedOnAddEdit}"/>
</p:inputText>
<h:outputText value="Trip Time:" />
<p:inputText id="tripTimeOnMobile"
value="#{pf_ordersController.tripTime[0]}"
label="Trip Time" type="time">
<f:convertDateTime pattern="HH:mm" />
<p:ajax partialSubmit="false"
update="@(.ui-panel) :orderEditForm:formMessages :orderEditForm:_ajax_status"
listener="#{pf_ordersController.tripTimeChangedOnAddEdit()}"/>
</p:inputText>
</h:panelGrid>
you may ask, and how do you merge the date and time back into one java.util.Date value? Simple, use joda-time library/JAR!!! Google it, download it, and start using it!
Code: Select all
// tripDateTime
DateTime dt_tripTime = new DateTime(tripTime.get(0));
DateTime tripDateTime = new DateTime(tripDate.get(0)).withHourOfDay(dt_tripTime.getHourOfDay())
.withMinuteOfHour(dt_tripTime.getMinuteOfHour());
current.setTripDateTime(tripDateTime.toDate());
and you may ask, why do I have the following bean attributes referenced in the bean and xhtml?
Code: Select all
private List<Date> tripDate, tripTime
because, there is a page that I want to develop that require multiple dates/times to be entered by enduser, but that is still on the to-do list. In the meanwhile, I tweaked the static web page, running on the public web site, which uses CGI to send formmail to an email acct, which is monitored by this java web app, and data is downloaded and stored into the database via
a bean defined/marked with the following:
Code: Select all
@Singleton
@Lock(LockType.WRITE)
@AccessTimeout(value = 2, unit = TimeUnit.MINUTES) bean
and a @Schedule method on that/similar bean...learned to do this from TomEE committers.
So, not a real big need for the xhtml page to be developed...right now.