I prefer to use a .cfm for my form action that interacts with the cfc.
Keeps the cfc a black box.  Then the .cfm decides what to do if the cfc
action succeeds or fails.
 

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 10:12 AM
To: CF-Talk
Subject: RE: CFLOCATION inside CFCs

I use this for CFC's that are meant to be the action of forms.  This is
actually shown in the documentation.

FORM.cfm
<form action="processing.cfc" ...>
   <input type="hidden" name="method" value="methodName">
</form>

PROCESSING.cfc
<cfcomponent>
   <cffunction name="methodName" ...>
      Do everything I want to do when form is submitted, including calling
other business logic CFC functions.
      <cflocation url="whereIWantToBeWhenDone.cfm">
   </cfunction>
</cfcomponent>

You need the location in this kind of use, otherwise the browser is setting
on the processing cfc when all is done.  I like to use it in this manner.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

.....-----Original Message-----
.....From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
.....Sent: Friday, March 04, 2005 8:56 AM
.....To: CF-Talk
.....Subject: CFLOCATION inside CFCs
.....
.....This is another 'what are you doing' and 'does it sound right' topics.
.....I'm
.....cleaning up some CFCs here and the programmer put some CFLOCATION tags
.....inside the CFC. Anyone else do this? Anyone see a problem with it?
.....
.....Personally, I'm not happy about it as it breaks encapsulation and makes
.....debugging a chore.
.....
.....
.....
.....



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197470
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to