I am trying to validate a calendar as an input text with popup button the input text has been validating correctly. However the selection of a date from the popup button cannot be validated My xhtml code is:
<p:calendar value="#{indexBean.searchCriteria.date}"
id="date" showOn="button"
mindate="#{indexBean.searchCriteria.mindate}" maxdate="#{indexBean.searchCriteria.maxdate}"
label="Date" converterMessage="The Date must be of the form DD/MM/YYYY and be a valid date"
pattern="dd/MM/yyyy" validator="#{indexBean.validateDate}" widgetVar="dateCalendar"
timeOnly="false">
<f:convertDateTime pattern="dd/MM/yyyy" />
<p:ajax update=":messages" event="change" />
</p:calendar>
what should i do to apply the validation on the popup button as well???
Using ajax, you should be able to key into the dateSelect
event of the calendar, and perform a standard, ajax driven validation. According to the docs, the popup mode can also trigger ajax events on blur
and keyup
. The change
you've specified is only good for the input text bit of the calendar
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.