On 6/5/08, Matt Williams <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 5, 2008 at 1:21 PM, Jamie Jackson <[EMAIL PROTECTED]> wrote:
> > Say a Customer has both a WorkAddress and a HomeAddress (both of these
> > are Address records).
> >
> > When you validate a customer form that has both of these addresses,
> > how do you distinguish between the WorkAddress and HomeAddress when
> > you use Reactor's validation?
>
>
> For validating those two records, logic would have that when you're
> creating or updating them they would be differentiated somehow.
>
> <cfset workAddress =
> reactor.createRecord('address').load(addressID=arguments.workAddressID)
> />
> <cfset homeAddress =
> reactor.createRecord('address').load(addressID=arguments.homeAddressID)
> />
>
> So with that, after calling your set methods, you would be able to do
> <cfset workAddress.validate() /> and <cfset homeAddress.validate() />
Hi Matt,
I think what I'll have to do is keep each error collection separate
all the way back to the view and do something like:
-----------------------------
There were problems with your form submission:
*Customer:
*The First Name is required
*Work Address:
*Address 1 is required
*The Zip Code is too long
*The Zip Code is not in the proper format
*The State is required
*Home Address:
*Address 1 is required
*The CIty is too long
*Work Phone
*The Phone is required
*Home Phone
*The Phone is not in the proper format
----------------------------------
Instead of (a flatter version):
----------------------------------
*The First Name is required
*The Work Address 1 is required
*The Work Zip Code is too long
*The Work Zip Code is not in the proper format
*The Work State is required
*The Home Address 1 is required
*The Home CIty is too long
*The Work Phone is required
*The Home Phone is not in the proper format
----------------------------------
> > BTW, Reactor validation *is* completely undocumented, isn't it? (I
> > want to make sure I didn't miss something.)
>
>
> Reactor is partially documented:
> http://livedocs.reactorframework.com/Reactor_Documentation.htm
I meant specifically Reactor *validation* documentation. I just
re-skimmed the docs above, and I didn't see any mention.
> > Also, is anybody successfully using Reactor validation for anything
> > more than small apps? I'd be interested to know about tips, tricks,
> > and/or pitfalls before taking the plunge.
>
>
> There have been many discussions on validation on various blogs and on
> the CFC-Dev mail list. There is also a project that Alagad has:
>
> http://www.alagad.com/go/products-and-projects/validat-data-validation-engine/validat-data-validation-engine
Thanks for the references to broader topics on validation. I'm aware
of Mark Drew's MG action pack, Jeff Chastain's Validat, and some of
the code generator based validation, but I'm wondering specifically
about Reactor's validation at present. (I don't want to completely
ditchReactor validation without knowing more about it.)
Thanks,
Jamie
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --