Late last week I ran across a very strange Javascript error when putting together a few related selects. The error would appear whenever the bind function was fired on one of the select boxes. After some head scratching it finally dawned on me what the issue was. Since the bind function was making a direct call to a CFC, I needed the infamous “kill the request scope” code in my application file. After updating the onRequestStart function in the application.cfc file the issue went away. The code to do this is below.
I’ve not heard of the infamous “kill the request scope” code. What is it and why is killing the request scope needed?
Posted by Henry ho | March 9, 2009, 8:04 PMI’ve not heard of the infamous “kill the request scope” code. What is it and why is killing the request scope needed?
Posted by Henry ho | March 9, 2009, 3:04 PMHenry,
I do not know the exact cause of the issue, but it seems to be a bug. You have to include the code in your application.cfc file to use Flash remoting, web services or some of the AJAX stuff when binding directly to a CFC. It seems ColdFusion gets confused a little by trying to handle the request as a PAGE, which it really isn’t. Ray Camden has mentioned this issue as well:
http://www.coldfusionjedi.com/index.cfm?mode=entry&entry=ED9D4058-E661-02E9-E70A41706CD89724
Posted by Mike Fleming | March 9, 2009, 8:31 PMHenry,
I do not know the exact cause of the issue, but it seems to be a bug. You have to include the code in your application.cfc file to use Flash remoting, web services or some of the AJAX stuff when binding directly to a CFC. It seems ColdFusion gets confused a little by trying to handle the request as a PAGE, which it really isn’t. Ray Camden has mentioned this issue as well:
http://www.coldfusionjedi.com/index.cfm?mode=entry&entry=ED9D4058-E661-02E9-E70A41706CD89724
Posted by Mike Fleming | March 9, 2009, 3:31 PMI know this is wicked old, but I just ran into this problem and the only place I could find the code to solve it was on the LAST COMMENT on Sean Corfield’s site here: http://corfield.org/entry/Applicationcfc__onRequest_and_CFCs
Posted by Adam | October 19, 2010, 1:26 AM