CFGrid Gotcha

So, I'm finally playing with some of the new Ajax controls built into ColdFusion 8. They're based on ExtJS (for the most part), and I thought it would be cool to dig in and see what I could do.

So, pulled up the documentation. First I built a basic CFC, with a remote access method that pulls all of the records from the Art table of the cfartgallery db. Then I built the display page, with the cfgrid and cfgridcolumn tags. I used the bind attribute to bind the grid to the cfc method. Tried it out and...error.

CFGRID: Response is empty [Enable debugging by adding 'cfdebug' to your URL parameters to see more information.]

OK. Fun. No response messages showing in Firebug, but the right parameters were getting passed through. Google is your friend, right? One reference that I could find, in the comments on a post at Ben's site, but it only pointed me towards the Application.cfc, with no explanation on what the problem was or how to fix it.

So, I changed the file name of my Application.cfc. I didn't need it this early in the game, so I took it out of play. Voila! It works. OK, so what's in the Application.cfc?

Well, I had already commented out the onError method (figuring out an issue with Coldspring). There wasn't any output in any of the methods. I went over all of my attributes and mappings...nothing. Then I noticed something.

I took the Application.cfc template from Ray's site, with very minor adjustments. I finally noticed that one function didn't have an 'output' attribute, onRequest.

<cffunction name="onRequest" returnType="void">
        <cfargument name="thePage" type="string" required="true" />
        <cfinclude template="#arguments.thePage#" />
    </cffunction>

Once I commented this function out the call worked perfectly. Well, lessons learned...

Related Blog Entries

TweetBacks
Comments
Michael White's Gravatar you might find the same behaviour with flash forms
# Posted By Michael White | 10/18/07 11:14 AM
Pete's Gravatar Thanks, Cutter, saved me some hairpulling with this one.
# Posted By Pete | 11/16/08 2:33 PM
Jennifer's Gravatar If you're getting CFGRID: Response is empty, and I know this sounds like a no-brainer, check your SQL statement carefully. That was my issue.
# Posted By Jennifer | 12/2/08 4:02 PM
steve's Gravatar thanks a bunch! for me it was a loose <link> tag referencing a stylesheet (which I wasn't using) in my application.cfm
# Posted By steve | 2/13/09 2:19 PM
Dan Parker's Gravatar Wow, man, thanks for posting this....I had to do exactly what you described to get my grid to work..I just started using Application.cfc not too long ago too...that would've been a pain to figure out without your post!
# Posted By Dan Parker | 5/5/09 10:01 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.006. Contact Blog Owner. Layout inspired by bluerobot.com., with some JQuery thrown in for fun.