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.
PF 8.0 <p:calendar not displaying validation error with <f:convertDateTime
-
- Posts: 2
- Joined: 28 Jul 2021, 22:13
Michael Boyer
PF 8.0
JSF 2.2
JBoss EAP 7.2
RHEL 6.10
PF 8.0
JSF 2.2
JBoss EAP 7.2
RHEL 6.10
-
- Posts: 2
- Joined: 28 Jul 2021, 22:13
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>
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
PF 8.0
JSF 2.2
JBoss EAP 7.2
RHEL 6.10
Thanks for posting that you fixed it!
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Information
-
Who is online
Users browsing this forum: No registered users and 29 guests