Brian,

Just to confirm, you clone a copy of the transfer object and then
attempt to set each of the properties with a <cftry><cfcatch> around
it so if any of the properties fails to set you note it, and if no
errors were detected you make a second pass at each property for the
additional rules? If any errors were detected on either pass you
return the cloned object to the form to re-populate the form. If no
errors were detected, save the cloned transfer object, if saved
successfully, update your original object from the clone?

Sorry if that is a little incoherent, but I want to make sure I am
following you from form submission and back to the form if errors
occur, and if not, persisting to the DB. I have read the other posts
in the group here regarding changing the type to "Any" or not and I
think that is what you were addressing here. Also the issue of making
sure the session scope object in in sync as to what is in the DB.

Thanks,

Dan

On Wed, Sep 24, 2008 at 12:22 PM, Brian Kotek <[EMAIL PROTECTED]> wrote:
> I have a Validator that first attempts to set the properties on the bean (I
> use a Transfer object that has been cloned so that the updates don't affect
> the real object until it is saved, but this could be done manually as well).
> If any properties fail to be set (argument type failure), I record those as
> validation errors and then move on. After the properties are set I run a
> validation on them to ensure that they conform to my rules (unique value,
> between two numbers, required, greater than/less than, etc.) and capture
> those as well. Only if the validator has no errors at this point do I save
> the object. So you don't have to type your arguments to any, you can just
> capture setter failures and treat them like any other validation failure.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to cfcdev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to