ClientSideValidation seems not to work with p:calendar #1986

Closed
mertsincan opened this Issue Dec 26, 2016 · 1 comment

Projects

None yet

2 participants

@mertsincan
Member

Reported By PRO User;

the clientSideValidation seems not to work properly with p:calendar.

  1. Example:
    i type in both fields the same value '24.12.2017'
    if i press the validate button only the p:inputText gets invalid.
<p:panelGrid layout="grid" columns="2" columnClasses="ui-g-4, ui-g-8" id="myGrid">
  <p:outputLabel for="calendar" value="calendar (@Past):" />
  <h:panelGroup>
    <p:calendar id="calendar" value="#{calendarView.pastDate}" pattern="dd.MM.yyyy" showOn="button">
    </p:calendar>
    <p:message for="calendar" />
  </h:panelGroup>

  <p:outputLabel for="pastDate" value="Date (@Past)" />
  <h:panelGroup>
    <p:inputText id="pastDate" value="#{calendarView.pastDate}">
      <f:convertDateTime pattern="dd.MM.yyyy" />
    </p:inputText>
    <p:message for="pastDate" />
  </h:panelGroup>
</p:panelGrid>

<p:commandButton validateClient="true" value="Validate" update="myGrid" process="myGrid" />
  1. Example
    if i type in '24.12.2017' and get out, the clientValidation triggers no error, only the ajax afterwards get the @past Error.
    but the 'required' Validation seems to work in clientSide if i clear the calendar
<p:panelGrid layout="grid" columns="2" columnClasses="ui-g-4, ui-g-8"
	id="myGrid">
	<p:outputLabel for="calendar" value="calendar (@Past):" />
	<h:panelGroup>
		<p:calendar id="calendar" value="#{calendarView.pastDate}"
			pattern="dd.MM.yyyy" showOn="button" required="true">
			<p:clientValidator event="change" />
			<p:ajax event="change" process="@this" update="myGrid" />
		</p:calendar>
		<p:message for="calendar" />
	</h:panelGroup>
</p:panelGrid>
@mertsincan mertsincan added this to the 6.1 milestone Dec 26, 2016
@mertsincan mertsincan added a commit that closed this issue Dec 26, 2016
@mertsincan mertsincan Fixed #1986 740e35c
@melloware

This user on the forum is reporting an issue with p:calendar in 6.0.13 so there might be a regression associated with this..

http://forum.primefaces.org/viewtopic.php?f=3&t=48865&p=150962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment