PF 8.0 <p:calendar not displaying validation error with <f:convertDateTime

UI Components for JSF
Post Reply
michaelboyer1
Posts: 2
Joined: 28 Jul 2021, 22:13

28 Jul 2021, 22:51

We are attempting to upgrade from PrimeFaces 6.1 to PrimeFaces 8.0, and now our <p:calendar tags when a user manually enters an invalid date of "00/00/0000" the <f:convertDateTime pattern="MM/dd/yyyy" /> tag does not display the conversion error on the web page like it used to with PrimeFaces 6.1. Here is the snippet of code for one of our calendar tags:

<p:calendar value="#{ln00Bean.requestDate}" immediate="true"
size="8" pattern="MM/dd/yyyy" mask="true" id="requestDate"
maxlength="10" title="Enter Report Begin Date" accesskey="R">
<f:convertDateTime pattern="MM/dd/yyyy" />
</p:calendar>

It looks like the when the page is submitted the < <f:convertDateTime pattern="MM/dd/yyyy" /> tag is firing but the invalid date error never displays, and the backing bean logic is never called, the page appears to hang until refreshed manually.
Michael Boyer
PF 8.0
JSF 2.2
JBoss EAP 7.2
RHEL 6.10

michaelboyer1
Posts: 2
Joined: 28 Jul 2021, 22:13

29 Jul 2021, 17:26

I figured it out. I hadn't added a reference in my <p:commandButton 's "update" attribute to reference the <p:messages tag on the page.

Updated snippet from the page code:

<h:outputLabel for="requestDate" value="REQUEST DATE:"
styleClass="ts00-subheader" />



<p:calendar value="#{ln00Bean.requestDate}" immediate="true"
size="8" pattern="MM/dd/yyyy" mask="true" id="requestDate"
maxlength="10" title="Enter Report Begin Date" accesskey="R">
<f:convertDateTime pattern="MM/dd/yyyy" />
</p:calendar>



<p:messages autoUpdate="true" redisplay="true" closable="true"
id="calMsg" />


Command button:

<p:commandButton value="Search" id="search" title="Search Button"
style="margin-left:10px;" styleClass="menu_button_bottom"
action="#{ln00Bean.search}" onstart="waitcursor();" update="calMsg"
accesskey="s">
</p:commandButton>
Michael Boyer
PF 8.0
JSF 2.2
JBoss EAP 7.2
RHEL 6.10

Melloware
Posts: 2829
Joined: 22 Apr 2013, 15:48

29 Jul 2021, 19:55

Thanks for posting that you fixed it!
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.4 / PF Extensions 10.0.3

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests