Hi,
I am facing the exact same issue and I have been searching for a long time to find out what am I doing wrong in my code.
(I know I am doing wrong because I cannot replicate the same behavior in showcase example for Calendar, FYI)
I am Using Primefaces 3.4 and Mojarra 2.1.9.
Here is the code
Code: Select all
<h:panelGrid id="datesPanelGrid" columns="2">
<b>Start Date:</b>
<p:calendar id="selectBeginDate" value="#{gpsMessagesView.beginDate}"
readOnlyInputText="true" navigator="true"
pattern="MM/dd/yyyy HH:mm:ss">
</p:calendar>
<b>End Date:</b>
<p:calendar id="selectEndDate" value="#{gpsMessagesView.endDate}"
readOnlyInputText="true" navigator="true"
pattern="MM/dd/yyyy HH:mm:ss">
</p:calendar>
</h:panelGrid>
My backing bean code
Code: Select all
........
private Date beginDate;
private Date endDate;
.........
.........
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
............
Issue: As soon as I click in the "inputText" box for p:calendar, it auto populates "today's date 00:00:00" for the first time. This however is not true when we manually "delete" the "auto populated date/time", (click somewhere else on the page) then come back and click in the "inputText" box for p:calendar the second time. Is the explanation clear? I hope so. If not let me know and I can explain it further.
I believe this behavior is caused by the "javascript", since anything being done in the backing bean is not influencing the outcome of the p:calendar. It is just a guess. I am not good with Javascript.
@Andy (or anyone else viewing this post),
Can you tell me if it is a bug in 3.4? FYI, this behavior doesn't happen in the showcase example, which, I believe, is currently running on primefaces 3.5.
@Javaone9,
Were you able to find any solution to this problem?