You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2005/07/13 22:53:28 UTC
Question about validation
Hi,
I was wondering if there was a validator that compares two fields to
see if they match. Basically for an input password and verify
password in a form. I know I could do post processing but it would be
nice to have it validate the same way.
If so could someone give an example on how to set it up?
Thanks.
--
~chris
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Question about validation
Posted by JIM WEAVER <we...@gmail.com>.
You can access the delegate declared in your page specification and
call record on it:
IValidationDelegate delegate = (IValidationDelegate)
getBeans().getBean("yourDelegateName");
delegate.record("Password must match verify password",
ValidationConstraint.CONSISTENCY);
We have had some problem doing this kind of thing though - the
"manual" validations work, but when mixed with declarative validations
(required field in the page specifications) we have trouble getting
them to happen in the order we'd like.
Things seem to behave better when we create our own Validator class
for a given validation and plug it in via the specification rather
than directly doing the validation in the page class.
Based on the signatures of the validator classes, I'm not sure how
you'd do a dependent field validation though. The methods we've
overridden in our own validator subclasses just pass down a single
field value.
jim
On 7/14/05, Chris Chiappone <ch...@gmail.com> wrote:
> Ok I guess this leads me to another question. If I were to do a
> manual check to see if the two fields were matching in my Page Class,
> how do you go about sending an error back to the page the same way the
> validator works if the two fields didn't match?
>
> On 7/14/05, Ron Piterman <mp...@vollbio.de> wrote:
> > I did not implement this yet, but its not attaching two fields to the
> > same validator.
> > It susually only the *second* one which will be *compared to* the first one.
> >
> > so this is theoretically not so difficult:
> > validators="identity=password"
> >
> > you can post the class if you implement it, many people will be glad to
> > have such a thing. I wonder it is not in 4.
> >
> > Cheers,
> > Ron
> >
> >
> >
> > ציטוט Jamie Orchard-Hays:
> > > I don't know how you'd attach two fields two one validator at the same
> > > time. I'm curious if someone has solved this using a validator. I've
> > > just done comparisons in the listener method.
> > >
> > > Jamie
> > > On Jul 13, 2005, at 4:53 PM, Chris Chiappone wrote:
> > >
> > >> Hi,
> > >>
> > >> I was wondering if there was a validator that compares two fields to
> > >> see if they match. Basically for an input password and verify
> > >> password in a form. I know I could do post processing but it would be
> > >> nice to have it validate the same way.
> > >> If so could someone give an example on how to set it up?
> > >> Thanks.
> > >>
> > >> --
> > >> ~chris
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >>
> > >>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> --
> ~chris
>
Re: Question about validation
Posted by Chris Chiappone <ch...@gmail.com>.
Ok I guess this leads me to another question. If I were to do a
manual check to see if the two fields were matching in my Page Class,
how do you go about sending an error back to the page the same way the
validator works if the two fields didn't match?
On 7/14/05, Ron Piterman <mp...@vollbio.de> wrote:
> I did not implement this yet, but its not attaching two fields to the
> same validator.
> It susually only the *second* one which will be *compared to* the first one.
>
> so this is theoretically not so difficult:
> validators="identity=password"
>
> you can post the class if you implement it, many people will be glad to
> have such a thing. I wonder it is not in 4.
>
> Cheers,
> Ron
>
>
>
> ציטוט Jamie Orchard-Hays:
> > I don't know how you'd attach two fields two one validator at the same
> > time. I'm curious if someone has solved this using a validator. I've
> > just done comparisons in the listener method.
> >
> > Jamie
> > On Jul 13, 2005, at 4:53 PM, Chris Chiappone wrote:
> >
> >> Hi,
> >>
> >> I was wondering if there was a validator that compares two fields to
> >> see if they match. Basically for an input password and verify
> >> password in a form. I know I could do post processing but it would be
> >> nice to have it validate the same way.
> >> If so could someone give an example on how to set it up?
> >> Thanks.
> >>
> >> --
> >> ~chris
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
~chris
Re: Question about validation
Posted by Ron Piterman <mp...@vollbio.de>.
I did not implement this yet, but its not attaching two fields to the
same validator.
It susually only the *second* one which will be *compared to* the first one.
so this is theoretically not so difficult:
validators="identity=password"
you can post the class if you implement it, many people will be glad to
have such a thing. I wonder it is not in 4.
Cheers,
Ron
ציטוט Jamie Orchard-Hays:
> I don't know how you'd attach two fields two one validator at the same
> time. I'm curious if someone has solved this using a validator. I've
> just done comparisons in the listener method.
>
> Jamie
> On Jul 13, 2005, at 4:53 PM, Chris Chiappone wrote:
>
>> Hi,
>>
>> I was wondering if there was a validator that compares two fields to
>> see if they match. Basically for an input password and verify
>> password in a form. I know I could do post processing but it would be
>> nice to have it validate the same way.
>> If so could someone give an example on how to set it up?
>> Thanks.
>>
>> --
>> ~chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Question about validation
Posted by Jamie Orchard-Hays <ja...@dang.com>.
I don't know how you'd attach two fields two one validator at the
same time. I'm curious if someone has solved this using a validator.
I've just done comparisons in the listener method.
Jamie
On Jul 13, 2005, at 4:53 PM, Chris Chiappone wrote:
> Hi,
>
> I was wondering if there was a validator that compares two fields to
> see if they match. Basically for an input password and verify
> password in a form. I know I could do post processing but it would be
> nice to have it validate the same way.
> If so could someone give an example on how to set it up?
> Thanks.
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org