Link to home
Start Free TrialLog in
Avatar of Eric Bourland
Eric BourlandFlag for United States of America

asked on

CFGRID will not display

ColdFusion 8
MS Access 2003

I am having a day of erratic ColdFusion development. =) My next problem is, my CFGRID will not display its data.

Following the code in the Forta CF 8 book, I use this code for CFGRID -- please see attached. It is pretty simple code.

The page is viewable here: http://www.careplanners.net/sortCareplanners.cfm

However, you will note that the CFGRID does not display. If you view the page source (in MSIE) you can see that the application does call data from the datasource. But that data does not display in CFGRID.

Notes:

* The datasource is an MS Access database
* I have tried different CFGRID formats including format="html", format="xml", format="flash" ... none work.

Does anyone have an idea why my CFGRID will not display?

Thanks as always for your advice.

Eric
<!--- Set the datasource --->
 <cfset ds="Careplanners">
 
  <cfquery datasource="#ds#" name="GetCareplanners">
  SELECT *
  FROM directory
  </cfquery>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Careplanners Data</title>
</head>

<body>



<cfform>
<cfgrid name="showCareplanners"
format="html"
width="100%"
query="GetCareplanners" />
</cfform>




</body>
</html>

Open in new window

Avatar of reiters
reiters
Flag of United States of America image

It looks like you forgot your <cfajaximport tags="cfgrid">

When doing anything with ajax I use Firefox with the "web developer" addon and "firebug" addon.  It gives you much more insight as to what is happening.
Avatar of Eric Bourland

ASKER

Thank you, reiters.

I did this:

<cfajaximport cssSrc="/CFIDE/scripts/ajax/resources/"
    scriptsrc="/CFIDE/scripts/css/"
    tags="cftooltip, cfwindow, cfgrid">

<cfform>


<cfgrid name="showCareplanners"
format="html"
width="100%"
query="GetCareplanners" />


</cfform>

... but still no CFGRID. Did I put the cfajaximport tag in the correct place? (Just before the CFFORM?)

I'll go download Firebug and see what I get from that. Thank you again!

Eric
OK, looking at http://www.careplanners.net/sortCareplanners.cfm using Firefox / Firebug, I see that I get a series of "ColdFusion is not defined" errors.

What do you make of that?
Untitled-1.png
It looks like the server is not set up correctly to allow you to use the ajax JS files that are included with cf8 and cf9.  ARe you on shared hosting or your own server?
I have my own server with root access.
If set up correctly you should be able browse to http://www.careplanners.net/CFIDE/scripts/ajax/messages/cfmessage.js and see the javascript
IF you have moved CFIDE then you need to point <cfajaximport> to its new location.  If you have secured that folder with permissions then you need to unsecure the "scripts" folder.
OK. I have not moved CFIDE. It is located here:

C:\Inetpub\wwwroot\CFIDE\scripts\ajax\messages

And /CFIDE/scripts/ajax/messages/cfmessage.js should resolve in a browser.

I just checked the permissions, and anonymous internet users have permission to read and execute files in the /scripts/ folder and its subfolders.

Hmmm.

I put the <cfajaximport> tag in the right place, correct?

<cfajaximport cssSrc="/CFIDE/scripts/ajax/resources/"
    scriptsrc="/CFIDE/scripts/css/"
    tags="cftooltip, cfwindow, cfgrid">

<cfform>


<cfgrid name="showCareplanners"
format="html"
width="100%"
query="GetCareplanners" />


</cfform>
I apologize for not being complete.  The messages file was an example of how your scripts directory could not be reached.  You should put all the contents of the scripts folder in the new location and reference it in the scriptsrc attribute.
I tried http://www.careplanners.net/CFIDE/scripts/ajax/messages/cfmessage.js and did not get any content.

Double check the csssrc vs scriptsrc.  You may have those backwards.  Either way I am unable to browse to your script files.

<cfajaximport cssSrc="/CFIDE/scripts/ajax/resources/"
    scriptsrc="/CFIDE/scripts/css/"
    tags="cftooltip, cfwindow, cfgrid">

I believe you want everything from /CFIDE/ajax put in it's original place and able to get to them from the browser.  You do not have to put in the csssrc and scriptsrc if they are in the original place.
>>I believe you want everything from /CFIDE/ajax put in it's original place and able to get to them from the browser.

I agree.

>>> You do not have to put in the csssrc and scriptsrc if they are in the original place.

That is what I understand, too, from reading the documentation.

The weird thing is, I have never moved /CFIDE/ or any of its content.

There might be something else going on here. I am going to check a couple of things. Be right back.

Thank you again! =) I really appreciate your time.
It is either a permissions issue or you have a virtual directory that is interfering with the folders.  It is probably an IIS issue.

1. Make sure the folder exists
2. make sure the files on the file system have permission
3. make sure you have script access set in IIS on that folder and permission are all correct
As a way to see what is going on if you are not aware now, you can open firebug and refresh the page.  Go to the HTML tab and expand "head" and then scroll down to one od the <script> tags and expand it (by pressing the +).  You will see the generic "404 file not found" html code instead of the JS
Here is something interesting. When I enter my server's IP address, the cfmessage.js resolves correctly:

http://76.12.181.86/CFIDE/scripts/ajax/messages/cfmessage.js

1. Make sure the folder exists
2. make sure the files on the file system have permission
3. make sure you have script access set in IIS on that folder and permission are all correct

I understand what you are saying.

The folder does exist. I have a feeling it is not a permissions problem, or else we would get another error, like a 403 error: not permitted.

I think that existing web sites, other than the default web site at IP 76.12.181.86, do not know how to see the /CFIDE/ folder.

Of course I could be completely wrong about that. However I am going to pose this question to my ISP, hosting.com. They are pretty helpful. I will let you know what they say.

Thank you again for your help. I'll return here as soon as I know more.

Eric
ASKER CERTIFIED SOLUTION
Avatar of reiters
reiters
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think that is the problem. I am working on this.
Genius. That fixed it.

=)
Thank you reiters. This solved the problem. I shoulda known! =)

Eric B
Glad I could help