You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kris Rasmussen <kr...@yahoo.com> on 2004/04/11 04:13:46 UTC

How to handle optional valid fields????

I have a typical checkout page set up with a group of valid fields for the billing address and the shipping address. I want to be able to let the user check "ship to billing address" and have the shipping address fields ignored , however I cannot think of an elegant way to get the ValidationDelegate to ignore the shipping address fields even if there is an error in them. The best way would be to have two validationdelegates but I don't believe that is possible in the same form.
 
How can I accomplish this in an elegant way?
 
Kris


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th

Re: How to handle optional valid fields????

Posted by Kris Rasmussen <kr...@yahoo.com>.
Yeah, I thought of that but like you said its not very elegent. The ideal would be to have the ability to specifify validationdelegate groups of some sort, maybe via an encapsulating component.
 
Kris

Bryan Lewis <br...@maine.rr.com> wrote:
If the shipping-address fields must have validators, you can certainly
have multiple validators even though there will be only one
validationDelegate for the form.

But it sounds like those fields should simply not specify a validator,
that is, they're not required fields. If they're required *part* of the
time (like when the box isn't checked), you'd need a bit of code in your
formSubmit() method to check for non-null inputs in that case.

If all else fails, you can write custom code in your formSubmit() to
walk through the list of errors (with
validationDelegate.getFieldTracking()) and ignore the ones from the
shipping fields. Wouldn't be elegant though.


----- Original Message ----- 
From: "Kris Rasmussen" 
To: 
Sent: Saturday, April 10, 2004 10:13 PM
Subject: How to handle optional valid fields????


> I have a typical checkout page set up with a group of valid fields for
the billing address and the shipping address. I want to be able to let
the user check "ship to billing address" and have the shipping address
fields ignored , however I cannot think of an elegant way to get the
ValidationDelegate to ignore the shipping address fields even if there
is an error in them. The best way would be to have two
validationdelegates but I don't believe that is possible in the same
form.
>
> How can I accomplish this in an elegant way?
>
> Kris
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th

Re: How to handle optional valid fields????

Posted by Bryan Lewis <br...@maine.rr.com>.
If the shipping-address fields must have validators, you can certainly
have multiple validators even though there will be only one
validationDelegate for the form.

But it sounds like those fields should simply not specify a validator,
that is, they're not required fields.  If they're required *part* of the
time (like when the box isn't checked), you'd need a bit of code in your
formSubmit() method to check for non-null inputs in that case.

If all else fails, you can write custom code in your formSubmit() to
walk through the list of errors (with
validationDelegate.getFieldTracking()) and ignore the ones from the
shipping fields.  Wouldn't be elegant though.


----- Original Message ----- 
From: "Kris Rasmussen" <kr...@yahoo.com>
To: <ta...@jakarta.apache.org>
Sent: Saturday, April 10, 2004 10:13 PM
Subject: How to handle optional valid fields????


> I have a typical checkout page set up with a group of valid fields for
the billing address and the shipping address. I want to be able to let
the user check "ship to billing address" and have the shipping address
fields ignored , however I cannot think of an elegant way to get the
ValidationDelegate to ignore the shipping address fields even if there
is an error in them. The best way would be to have two
validationdelegates but I don't believe that is possible in the same
form.
>
> How can I accomplish this in an elegant way?
>
> Kris
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org