This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

validate convertDateTime

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I have this code:
<h:inputText id="data" value="#{uBean.data1}">
<f:convertDateTime pattern="dd-MM-yyyy" dateStyle="full"/>
</h:inputText>
Why if I write in "input text" one day wrong or one month wrong, validation generates a format error and if I write one year wrong, validation doesn't shows validation error?

If I write 12-13-1989 shows format error.
If I write 12-12-198 doesn't shows format error.

How do I do to generate error also for year?

Thanks
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems everything is right. After all, year 198 is valid. I don't remember what happened then, but it certainly is part of planet Earth's history. On the other hand, month 13 does not exist in our gregorian calendar. You see, the problem is not about the correctness of the date itself, but the correctness of its meaning. So you need validation for that date, perhaps by implementing a javax.faces.validator.Validator; at least that is my suggestion. Good luck
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Henrique Sousa:
It seems everything is right. After all, year 198 is valid. I don't remember what happened then, but it certainly is part of planet Earth's history.



I rememeber what happened. Everyone started freaking out about the year 200 and the fact that none of their scrolls were compliant. It was chaos. Goats were slaughtered and stored in shelters along with mass amounts of water in case the world ended.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember "Party like it's 199"?

 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic