1
Loading the date in a Calendar (Primefaces) normally loads:
Code:
<p:outputLabel value="Data de Nascimento" for="data-nascimento" />
<p:calendar id="data-nascimento" locale="pt" mask="99/99/9999"
value="#{solicitacaoRHBean.itemEdicao.dataNascimento}"
required="true" navigator="true"
requiredMessage="Data de Nascimento é obrigatório">
</p:calendar>
But at the time of validating/persisting the information gives error message saying that the date is not a valid date.
How to resolve this issue?
I’m afraid the problem is in "Mask", as the attribute itself points out, it’s just a mask. Try using the "Pattern" attribute instead of Mask:
pattern="dd/MM/yyyy"
.– ptkato
If you are looking for another alternative, I think it would be more feasible to use the Hibernate Validation Bean to make the validations. Following example: http://blog.caelum.com.br/java-ee-6-comecando-bean-validation/
– DiegoAugusto
Patrick, I traded the Mask for Pattern and it worked thanks.
– Marcelo Gomes