Tim, you'll probably need to do this type of conditional validation in a custom 
validation method. The other way to you might be able to do it is to use the 
"on" attribute of @Validate and have two different Resolution methods. That 
type of solution may or may not work depending on your situation, but you can 
even have the two methods be a simple call to a common resolution method that 
does all the work. That way they would only really be there for the different 
validation needs.


-Nick

On Apr 7, 2010, at 9:35 AM, Stone, Timothy wrote:

> List,
>  
> (Sorry for the premature send… not enough coffee this morning)
>  
> I have an action that has 3 fields:
>  
> prospectcode
> postcode
> lastname
>  
> The form that is bound to this action will only have 2 fields (both required 
> when present on the form):
>  
> prospectcode
>  
> and one (1) of
>  
> ‘lastname’ OR ‘postcode’
>  
>  
> If ‘postcode’ is not present on the form, but ‘lastname’ is, how can the 
> action ignore ‘postcode’ and return an error for ‘lastname’ only, i.e., if it 
> is blank?
>  
> Do I need to inspect the request parameters for the absence of one and the 
> presence of the other, ‘postcode’ is null so ignore, and ‘lastname’ is blank 
> (length returns 0). Though I have a gut feeling that Stripes intuitively 
> handles this in the binding of form to action and there is something I’m 
> missing about the annotations available in Stripes I’m not taking advantage 
> of.
>  
> Regards,
> Tim
>  
>  
> 
> 
> 
> _______________________________________________________
> 
> Barclays
> www.barclaycardus.com
> _______________________________________________________
> 
> This e-mail and any files transmitted with it may contain confidential and/or 
> proprietary information. It is intended solely for the use of the individual 
> or entity who is the intended recipient. Unauthorized use of this information 
> is prohibited. If you have received this in error, please contact the sender 
> by replying to this message and delete this material from any system it may 
> be on. 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev_______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to