Next Page

1

Previous Page

Thread: CFGRID and BIND do not populate grid

Created on: 04/28/08 02:51 PM

Replies: 8

djkoz


New Member


Joined: 04/28/08

Posts: 1

CFGRID and BIND do not populate grid
04/28/08 2:51 PM

I do not get ANY data displayed in a CFGRID using BIND.

I created a CFM file and a CFC file by copying the Artists code directly from Ben Forta's website. Both files are stored in root directory of my test site which is on my home computer running Windows XP PRO and the absolute latest version of CF 8.

I get NO CF errors. If I run ?CFDEBUG the AJAX output shows the query being executed and the data as being returned. The grid displays in my browser window with the headers. However, absolutely no data is displayed in the grid.

At the suggestions of others I've tried turning off the debug functions in CF Administrator and making all the names in the CFGRIDCOLUMN all capital. It didn't help.

If I don't use BIND but rather use something like <cfgrid name="someName" query=myQuery"> the data displays just fine. It's when I switch to the BIND format that things fall apart.

I really could use a bit of help. I am looking at a deadline of this weekend.

Thanks,

Dan

Link | Top | Bottom

marcovandenoever


Member


Joined: 02/20/07

Posts: 82

RE: CFGRID and BIND do not populate grid
07/10/08 6:08 AM

I am not really into the CFGRID and BIND thing, just a bit, but i think it's usefull to post some code or email some example etc.

As i see the date of this post and your deadline that was that weekend i asume it's no longer needed, if so please ask, if you allready had an solution can you share for the next one that runs into a similar problem?

Thanks!

Link | Top | Bottom

Bradley


Member


Joined: 05/12/08

Posts: 90

RE: CFGRID and BIND do not populate grid
07/17/08 7:43 AM

I use CFGRID pretty lightly, not very often at all. But for what it's used for, it's great! Getting it going is tough, yeah... but once you get it working, it's a workhorse and it won't let you down.

- Bradley
| http://bradleybeard.blogspot.com

Link | Top | Bottom

redcairo


New Member


Joined: 08/01/08

Posts: 1

RE: CFGRID and BIND do not populate grid
08/01/08 6:16 PM

I wish there was an answer to this because I'm having the same problem and I've been searching the whole day and not found a solution. My query when in the grid itself works perfectly, but I don't have pagination. I couldn't figure out how to get pagination without taking out the grid query and binding to a CFC instead. So now I got pagination but my grid mysteriously has no data and just shows the 'loading' thing indefinitely.

the cfc (comments.cfc):

view plain print about
1<cffunction name="comments" access="remote" returntype="struct">
2<cfargument name="page" required="true">
3<cfargument name="pageSize" required="true">
4<cfargument name="gridsortcolumn" required="true">
5<cfargument name="gridsortdirection" required="true">
6
7<cfparam name="find" default="0">
8<cfquery datasource="myds" name="selectall" maxrows="250">
9select dSessionID, theComment, DateEntered, Alias, '<img src="../shared/icons/external2.gif" border="0" />' As 'See'
10from table1 p,table2 u
11where {...}
12order by DateEntered desc
13</cfquery>
14
15<cfreturn queryconvertforgrid(comments,page,pagesize)/>
16</cffunction>

the cfml:

view plain print about
1<cfform name="myform" id="myformid">
2 <cfgrid name = "myGrid" format="html"
3 width="100%" pageSize="10" preservePageOnSort="true"
4        maxRows="25" selectMode="browse" selectOnLoad="no"
5 font="Verdana" fontsize="11" label="True"
6 stripeRowColor="##D9CCFF" selectColor="##994FE6" stripeRows="true"
7        href="myfile.cfm" style="a.link, a.link:visited {text-decoration: none;}"
8        bindOnLoad="yes" bind="cfc:comments.comments({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">

9 <cfgridcolumn name="dSessionID" display="no" >
10 <cfgridcolumn name="DateEntered" display="yes" header="Date" mask="EEE DD-MMM-YY H:NN A">
11 <cfgridcolumn name="Alias" italic="yes" display="yes" header="From">
12 <cfgridcolumn name="See" width="30" display="yes" >
13 <cfgridcolumn name="theComment" fontsize="1.2em" textColor="##661A99" width="650" display="yes" header="Comment">
14 </cfgrid>
15</cfform>

I'm exhausted just from spending the last too many hours trying to make a simple, one-link on an image, paginated html CFGRID which I thought would be easy after reading all the hype. I'm sure it is comparative to other code languages, but...! I'm just coming back to CF after a few years away so I'm relearning and all this part is new. Any help you guys could provide would be hugely appreciated.

Best,
PJ

Link | Top | Bottom

admin


Experienced Member


Joined: 04/08/04

Posts: 2,944

RE: CFGRID and BIND do not populate grid
08/04/08 6:37 AM

Did you debug with Firebug? I assume so. :) What did you see?

Link | Top | Bottom

Crazy


New Member


Joined: 05/16/08

Posts: 5

RE: CFGRID and BIND do not populate grid
08/12/08 8:50 PM

One thing you need to do is change the query name from 'selectall' to 'comments'

Link | Top | Bottom

Wolffen


New Member


Joined: 09/16/08

Posts: 2

RE: CFGRID and BIND do not populate grid
09/16/08 11:15 AM

I'm having the exact same issue as the original poster, and haven't been able to find a solution anywhere online.

Ben Forta's code can be found here:
http://www.forta.com/blog/index.cfm/2007/6/25/ColdFusion-Ajax-Tutorial-6-Editable-Data-Grids

It seems to be a very simple, straight-forward CFWindow containing a CFGRID bound to a CFC that calls the cfartgallery datasource.

Like the original poster, the AJAX debug window shows everything is kosher, shows the CFC returning data from its getArtists method...but the CFGRID never shows the data.

Meanwhile, if I take the exact same files and copy them to a dev system running the exact same version of CF8 and the same OS, it works fine.

And you know what? I think I found the next bit of info that probably explains all this: running the CFDEBUG url param in IE gives me different results than Firefox. In IE, the AJAX debug has the "window:global: Exception thrown and not caught" at line 787 error. Which apparently has something to do with Application.cfm/Application.cfc...time to do some more research.

Link | Top | Bottom

Wolffen


New Member


Joined: 09/16/08

Posts: 2

RE: CFGRID and BIND do not populate grid
09/16/08 11:40 AM

Sonnuvabit...jeez. OK, for anyone else running into this issue, check to see if your Application.cfm/Application.cfc is outputting ANYTHING to your web pages. Our websites have a simple html comment <--! Company Web Application --> , which is embedded in every page that is served up by CF. That tiny little thing is all it takes to break CFC binds in CFGRID or CFAJAXPROXY. Once I took that comment out out of the Application.cfm file, Ben's code works fine. Apparently if you are using Application.cfc, you might want to check to see if you are doing any styles in the onRequestStart function as well.

Link | Top | Bottom

marcovandenoever


Member


Joined: 02/20/07

Posts: 82

RE: CFGRID and BIND do not populate grid
09/16/08 1:00 PM

waaa one of those things huh :) thanks for sharing!

Link | Top | Bottom

Next Page

1

Previous Page

New Post

Please login to post a response.