Ok, just to see if I'm getting this down. What is being done here is that the Form Action Method is modifying global to the application variables, a 'model' object in your example I believe. And then uses <cflocation...> to return form the action method.
Is that an over simplification? Am I missing anything fundamental? -------------- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA > -----Original Message----- > From: Darron J. Schall [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 23, 2003 12:12 PM > To: CF-Talk > Subject: Re: Using a CFC as the action of a form. > > > I use CFC's for processing form input (though I always > structure my apps > with the MVC design pattern...) > > Something like this (this may or may not be useful for you.. > but I hope it > is!): > > <cfcomponent ...> > <cffunction name="edit" output="false" ...> > <cfargument ...> > > <!--- update the model ---> > <cfscript> > model = createObject("component", > "path.to.model.myModel"); > model.init(arguments.id); > model.setFirstName(arguments.firstName); > model.setLastName(arguments.lastName); > model.setEmail(arguments.email); > if (model.getID() eq 0) { > model.create(); // create a new entry > } else { > model.update(); // update an existing entry > } > </cfscript> > > <!--- update the view page ---> > <cflocation > url="formSubmitted.cfm?entryId=#model.getID()#" > addtoken="no"> > </cffunction> > </cfcomponent> > > -d > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138193 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm

