Hi,

 

Is there any way to validate what the user inputs in the InputDate control ?

If a user input a character in the day field then I get the next error :

 

<pre>

java.lang.NumberFormatException: For input string: "A"
        java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        java.lang.Integer.parseInt(Integer.java:447)
        java.lang.Integer.parseInt(Integer.java:497)
        org.apache.myfaces.custom.date.HtmlInputDate$UserData.parse(HtmlInputDate.java:208)
        org.apache.myfaces.custom.date.HtmlDateRenderer.getConvertedValue(HtmlDateRenderer.java:277)
        javax.faces.component.UIInput.getConvertedValue(UIInput.java:289)
        javax.faces.component.UIInput.validate(UIInput.java:265)
        javax.faces.component.UIInput.processValidators(UIInput.java:144)
        javax.faces.component.UIForm.processValidators(UIForm.java:68)
        javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)
        javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:142)
        org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
        org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
        org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
        org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

</pre>

 

I’ve tried writing a validator method in mi backing bean but before I could read the new value the error has already been tigered.

 

Thank you very much in advance.

 

Reply via email to