You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by TM...@cccis.com on 2005/10/21 18:34:22 UTC

Date validations

In regards to the Date component, has anyone added logic to prevent alpha
characters from being entered in the Day and Year fields?  This seems to
blow up when the form is submitted.  Also, the calendar popup does not work
properly when alpha characters are entered in the Year field.

<Oct 21, 2005 11:27:06 AM CDT> <Error> <HTTP> <BEA-101017>
<[ServletContext(id=866732,name=reminder,context-path=/reminder)] Root
cause of ServletException.
java.lang.NumberFormatException: For input string: "sdfg"
      at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:468)
      at java.lang.Integer.parseInt(Integer.java:518)
      at
org.apache.myfaces.custom.date.HtmlInputDate$UserData.parse(HtmlInputDate.java:210)
      at
org.apache.myfaces.custom.date.HtmlDateRenderer.getConvertedValue(HtmlDateRenderer.java:277)
      at javax.faces.component.UIInput.getConvertedValue(UIInput.java:289)
      at javax.faces.component.UIInput.validate(UIInput.java:265)
      at javax.faces.component.UIInput.processValidators(UIInput.java:144)
      at javax.faces.component.UIData.process(UIData.java:514)
      at
javax.faces.component.UIData.processColumnChildren(UIData.java:498)
      at javax.faces.component.UIData.processValidators(UIData.java:403)
      at javax.faces.component.UIForm.processValidators(UIForm.java:68)
      at
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)

Todd McCullough
Software Engineer
CCC Information Services, Inc.
312.846.7537