Looking at the Tap4 examples... you can always define a bean to specify
arbitrary validators:

Dates.page:

  <bean name="required"
class="org.apache.tapestry.form.validator.Required"></bean>
  <bean name="maxDate" class="org.apache.tapestry.form.validator.MaxDate">
    <set name="maxDate" value="new java.util.Date()"></set>
  </bean>
  <bean name="minDate" class="org.apache.tapestry.form.validator.MinDate">
    <set name="minDate" value="new java.util.Date()"></set>
  </bean>

Dates.html:
   <input jwcid="[EMAIL PROTECTED]" includeWeek="ognl:includeWeek"
value="ognl:startDate" displayName="Start Date"
validators="ognl:{beans.required,beans.maxDate}"/>


Alan Chandler wrote:

>I am running tap4.0 and I am struggling with date validation.  The 
>documentation is a bit sparse and both things I tried didn't work.
>
>Careful reading of the docs implies you should be able to do this
>
><input jwcid="[EMAIL PROTECTED]" 
>       size="11" tabindex="4" 
>       value="ognl:t.date" 
>       validators="validator:date,minimum=1/1/1999,maximum=1/1/2030"
>       translator="translator:date,pattern=dd-MMM-yy"
>       displayName="message:date"/>
>
>but I get a ClassCastException when I do
>
>I also tried this
>
> validators="validators:minDate=1/1/1999,maxDate=1/1/2030"
>
>as a replacement validators line, but whilst that allowed the page to work it 
>accepted any rubbish in the date field and just defaulted it to today.  I 
>want it to generate an error for my form validation delegate.
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to