You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Craig St Jean <va...@earthlink.net> on 2006/11/04 10:31:10 UTC

Date Validation Issue

Hello,
I'm trying to use a date picker with validation:
<binding name="translator" value="translator:date,pattern=yyyy/MM/dd"/>
<binding name="validators"  
value="validators:required,minDate=7/1/2006,maxDate=12/31/2006"/>

But I'm having 2 issues. First I keep getting this error:
Error initializing validator 'minDate' (class  
org.apache.tapestry.form.validator.MinDate): Unable to convert  
'7/1/2006' to type java.util.Date (for property minDate of object  
org.apache.tapestry.form.validator.MinDate@587271): Unparseable date:  
"7/1/2006"; - nested throwable: (java.text.ParseException:  
Unparseable date: "7/1/2006")

I've tried it as 2006-07-01, 07/01/06, 07/01/2006, etc, they all  
fail. Any clues? I'm following the book "Enjoying Web Development  
with Tapestry" and that is how they show to do it.

Secondly, is there any way to do something like minDate=currentDate?  
Using something like minDate=ognl:date and minDate=date fail (not  
that they should work, just trying random things).

System information:
Mac OS X 10.4.8
JBoss 4.0.5 GA Application Server
Tapestry 4.0.2
java version "1.6.0-dp"
Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-34)
Java HotSpot(TM) Core VM (build 1.6.0-b88-17-release, interpreted  
mode, sharing)

Thank you!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Date Validation Issue

Posted by Craig St Jean <va...@earthlink.net>.
Nevermind, after a lot of searching I found the issue: JBoss.
Apparently JBoss defines its date formats differently and I need to  
start it up with
-Dorg.jboss.util.propertyeditor.DateEditor.format=dd/MM/yyyy

See http://article.gmane.org/gmane.comp.java.tapestry.user/32671

On Nov 4, 2006, at 4:31 AM, Craig St Jean wrote:

> Hello,
> I'm trying to use a date picker with validation:
> <binding name="translator" value="translator:date,pattern=yyyy/MM/ 
> dd"/>
> <binding name="validators"  
> value="validators:required,minDate=7/1/2006,maxDate=12/31/2006"/>
>
> But I'm having 2 issues. First I keep getting this error:
> Error initializing validator 'minDate' (class  
> org.apache.tapestry.form.validator.MinDate): Unable to convert  
> '7/1/2006' to type java.util.Date (for property minDate of object  
> org.apache.tapestry.form.validator.MinDate@587271): Unparseable  
> date: "7/1/2006"; - nested throwable: (java.text.ParseException:  
> Unparseable date: "7/1/2006")
>
> I've tried it as 2006-07-01, 07/01/06, 07/01/2006, etc, they all  
> fail. Any clues? I'm following the book "Enjoying Web Development  
> with Tapestry" and that is how they show to do it.
>
> Secondly, is there any way to do something like  
> minDate=currentDate? Using something like minDate=ognl:date and  
> minDate=date fail (not that they should work, just trying random  
> things).
>
> System information:
> Mac OS X 10.4.8
> JBoss 4.0.5 GA Application Server
> Tapestry 4.0.2
> java version "1.6.0-dp"
> Java(TM) SE Runtime Environment (build 1.6.0-dp-b88-34)
> Java HotSpot(TM) Core VM (build 1.6.0-b88-17-release, interpreted  
> mode, sharing)
>
> Thank you!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org