On 8/26/05, Brian Kotek <[EMAIL PROTECTED]> wrote:
> Just as an example, this is an example of how I might process,
> validate, and persist some form data in a Fusebox 4.1 application.
> This would use a TO and a BO and eliminate my "in-between-Bean", and
> the BO would validate it's data from the passed TO. Anyone care to
> comment on it? Barney, is this getting closer to the nomenclature that
> you're familiar with?
> 
> <fuseaction name="storeContact">
>         <invoke object="application.TOFactory"
>                 methodcall="newTO( 'contact', attributes )"
>                 returnVariable="contactTO" />
>         <invoke object="application.BOFactory"
>                 methodcall="newBO( 'contact', contactTO )"
>                 returnVariable="contact" />
>         <if condition="#contact.validate()#">
>                 <true>
>                         <invoke object="application.contactManager"
>                                 methodcall="save( contact )" />
>                         <do action="success" />
>                 </true>
>                 <false>
>                         <invoke object="contact"
>                                 methodcall="getErrors"
>                                 returnVariable="errorTO" />
>                         <do action="showContactForm" />
>                 </false>
>         </if>
> </fuseaction>

Hi Brian,

Your code looks great, but I have a couple of questions, since I am an
OO newbie. :-)

Can you make an example of what the errorTO variable would contain? Is
it a struct or a full-blown object?

How would you code the form page to highligth the fields that have an error?
E.g. make the Name input field red, if it was left empty, or make the
Email field red, if an incorrect value was entered.

Thanks a lot.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to