Title: Message
The parameters of the validators are not meant to be set dynamically at runtime, they are created statically the first time they are accessed. 
 
Take a look at the _expression_ validators. There's an action level and field level, and they can evaluate any OGNL _expression_ (it should return a boolean in the end)... You could do something like this:
 
    <validator type="_expression_">
        <param name="_expression_">campaignTransport.startDate >= new java.util.Date()</param>
        <message>Start date must be in the future.</message>
    </validator>
 
 
and similar for comparing the start date and end date...
 
Jason
-----Original Message-----
From: Mathias Berg [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 9:10 AM
To: WebWork (E-mail)
Subject: [OS-webwork] Date Validation

Regarding DateRangeFieldValidation, i like to validate two date field, startDate and endDate by using validation framework.

Now using a [....]-validation.xml file, i wonder how i shall validate this situation.

First startDate must be >= then sysdate (today). How do i do that?

<field name="campaignTransport.startDate" >
        <field-validator type="date">
           <param name="min">campaignTransport.startDate >= $sysdate</param> ?????im guessing :)
           <message key="">Start date must be higer then $sysdate</message>
        </field-validator>
</field>

secondly is this right to validate if startDate is before endDate

<field name="campaignTransport.startDate" >
        <field-validator type="date">
           <param name="min">campaignTransport.endDate</param>
           <message key="">Start date must be before $campaignTransport.endDate</message>
        </field-validator>
    </field>

Any help is appreciated, i could find any manual stuff about this. Therefore this message.

Regards, Mathias.

By the way, nice work getting final ww2.0 version, we will soon be testing it ;-) We are still happy with beta2.

Reply via email to