Have a look at DateTimeField from YUI.
In any case, you can always create a FormValidator so it can validate
several components.
BTW,
you should really change the fields to be Integer and not String.


Eyal Golan
[email protected]

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Wed, Aug 19, 2009 at 5:49 AM, Arun Gupta <[email protected]> wrote:

> I have a form model defined as:
>
> -- cut here --
> public class RunlogFormModel implements Serializable {
>    private String month;
>    private String day;
>    private String year;
>    private String distance;
>    private String hour;
>    private String minute;
>    private String second;
>    private String comments;
> -- cut here --
>
> The form provides drop-down list boxes for each of the model elements
> and added to the form like:
>
> add(new DropDownChoice(. new PropertyModel(...).add(new
> IValidator<String>() { })));
>
> The validator can validate each individual field. How do I perform
> compositve date validation, such as month/day/year <= current_date ?
>
> Similarly how to perform validation of hour/minute/seconds > 0 ?
>
> How do I validate presence of date/time ?
>
> Is this a good representation of model or should it be represented
> differently ?
>
> Thanks,
> -Arun
>
> --
> Need Application Server ? - Download glassfish.org
> Blog: http://blogs.sun.com/arungupta
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to