I would take the form data, put it into a Bean as we've been talking
about in the Bean thread,  validate it, and use the data if it passes
validation, but redisplay the form if it fails. Something like this:

<fuseaction name="processregistration" access="public">
                <invoke object="application.beanFactory" 
                                methodcall="getBean( 'User', attributes )" 
                                returnvariable="userBean"/>
                <if condition="#userBean.validate()#">
                        <true>
                                <!-- Was the registration successful? -->
                                <invoke object="application.userManager" 
                                                
methodcall="processRegistration( userBean )"/>
                                <relocate 
url="#myFusebox.originalCircuit#.success"/>
                        </true>
                        <false>
                                <!-- If registration was not successful, 
display the registration
form again. -->
                                <do action="register" />
                        </false>
                </if>
        </fuseaction> 

At some point when I have time (ha!) I'd like to update this app in
several ways, using Beans and the related factory, and possibly
showing AJAX in use (using JSON).


On 8/29/05, wolf2k5 <[EMAIL PROTECTED]> wrote:
> On 8/29/05, Brian Kotek <[EMAIL PROTECTED]> wrote:
> > A wrap-up update here, over the weekend I realized that this idea of a
> > "Bean" to wrap up form/url data before handing it to the model
> > actually originated in JSP and Struts applications. So there IS a
> > precedent for this, even it doesn't seem to be too widespread.
> 
> Hi Brian,
> 
> I am learning Fusebox, OOP and MVC.
> 
> Your Fusebox 4.1 bookstore and Wegot Widgets applications have been
> very helpful to me ...
> 
> But it looks like the lack validation for the forms.
> How would you implement it?
> 
> Thanks.
> 
> 
> ----------------------------------------------------------
> 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]
> 
> 
>


----------------------------------------------------------
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