Re: validate nested beans part 2

2005-07-19 Thread Dave Newton

Scott Purcell wrote:


I dug myself into a corner last night and cannot assemble a viable solution.

I created a bean (usercheckout) which holds two nested beans (Shipping), and (Billing). 
Basically I have the user fill out a shipping form, then they fill out a Billing form. 
The problem is, when I am trying to validate the data, since both are called 
"usercheckout" I can either validate one but not the other. In my 
validation.xml I have this:

   
 
   

And that validates all the nested Billing bean properties. But now when I go to the 
shipping page, I do not know where to validate those because its name is 
"usercheckout".

If I add another field to the above form, then it appears to be looking for two 
names, etc.

Does this make sense?

If anyone has ideas, please let me know,
 

As Michael says, you'll want to use the action mappings as the keys in 
the validation file. Using Dyna beans I use DynaValidatorActionForm 
rather than DynaValidatorForm, so in my validation config file I can use 
the same beans in different actions with different validation rules.


A quick scan of the JavaDocs reveals that if you are hand-coding your 
beans there is a similar hierarchy on the non-dynamic side of things.


Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validate nested beans part 2

2005-07-19 Thread Michael Jouravlev
On 7/19/05, Scott Purcell <[EMAIL PROTECTED]> wrote:
> I dug myself into a corner last night and cannot assemble a viable solution.
> 
> I created a bean (usercheckout) which holds two nested beans (Shipping), and 
> (Billing). Basically I have the user fill out a shipping form, then they fill 
> out a Billing form. The problem is, when I am trying to validate the data, 
> since both are called "usercheckout" I can either validate one but not the 
> other.

I don't remember the syntax since I do not use validator, but you can
use mapping name instead of form name to distinguish between validated
objects.

Michael.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



validate nested beans part 2

2005-07-19 Thread Scott Purcell
I dug myself into a corner last night and cannot assemble a viable solution.

I created a bean (usercheckout) which holds two nested beans (Shipping), and 
(Billing). Basically I have the user fill out a shipping form, then they fill 
out a Billing form. The problem is, when I am trying to validate the data, 
since both are called "usercheckout" I can either validate one but not the 
other. In my validation.xml I have this:


  


And that validates all the nested Billing bean properties. But now when I go to 
the shipping page, I do not know where to validate those because its name is 
"usercheckout".

If I add another field to the above form, then it appears to be looking for two 
names, etc.

Does this make sense?

If anyone has ideas, please let me know,

Thanks,
Scott








   

  
  

   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]