You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by laredotornado <la...@gmail.com> on 2009/11/23 16:06:38 UTC
How do I validate a group of fields?
Hi,
I'm using MyFaces 1.1.6 with Tomahawk 1.1.9. I have 3 text fields, each
representing a date string, on my JSF page. I want to validate that each is
unique. Right now, I have this logic in my controller, but I would like the
errors to display along side other validation errors in my page. How should
I go about making this happen -- that is, getting the errors to appear
during the validation phase of my page?
- Dave
--
View this message in context: http://old.nabble.com/How-do-I-validate-a-group-of-fields--tp26479639p26479639.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: How do I validate a group of fields?
Posted by Gerhard Petracek <ge...@gmail.com>.
hi dave,
you can use @NotEquals of myfaces extval.
maybe you will be also interested in @DateIs, if the dates have to be in a
special order.
regards,
gerhard
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces
2009/11/23 laredotornado <la...@gmail.com>
>
> Hi,
>
> I'm using MyFaces 1.1.6 with Tomahawk 1.1.9. I have 3 text fields, each
> representing a date string, on my JSF page. I want to validate that each
> is
> unique. Right now, I have this logic in my controller, but I would like
> the
> errors to display along side other validation errors in my page. How
> should
> I go about making this happen -- that is, getting the errors to appear
> during the validation phase of my page?
>
> - Dave
> --
> View this message in context:
> http://old.nabble.com/How-do-I-validate-a-group-of-fields--tp26479639p26479639.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
Re: How do I validate a group of fields?
Posted by Mike Kienenberger <mk...@gmail.com>.
Have you looked at validateCompareTo (CompareToValidator) that I
mentioned earlier? That would be one of the things you can use it
for. Something like this.
<text2/>
<text2>
<validateCompareTo for=text3 operation="ne"/>
</text2>
<text1>
<validateCompareTo for=text2 operation="ne"/>
<validateCompareTo for=text3 operation="ne"/>
</text1>
On Mon, Nov 23, 2009 at 10:06 AM, laredotornado <la...@gmail.com> wrote:
>
> Hi,
>
> I'm using MyFaces 1.1.6 with Tomahawk 1.1.9. I have 3 text fields, each
> representing a date string, on my JSF page. I want to validate that each is
> unique. Right now, I have this logic in my controller, but I would like the
> errors to display along side other validation errors in my page. How should
> I go about making this happen -- that is, getting the errors to appear
> during the validation phase of my page?
>
> - Dave
> --
> View this message in context: http://old.nabble.com/How-do-I-validate-a-group-of-fields--tp26479639p26479639.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>