[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 847
  • Last Modified:

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

0
Eric Bourland
Asked:
Eric Bourland
  • 10
  • 9
1 Solution
 
reitersCommented:
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.
0
 
Eric BourlandAuthor Commented:
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
0
 
Eric BourlandAuthor Commented:
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
0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
reitersCommented:
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?
0
 
Eric BourlandAuthor Commented:
I have my own server with root access.
0
 
reitersCommented:
If set up correctly you should be able browse to http://www.careplanners.net/CFIDE/scripts/ajax/messages/cfmessage.js and see the javascript
0
 
reitersCommented:
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.
0
 
Eric BourlandAuthor Commented:
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>
0
 
reitersCommented:
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.
0
 
reitersCommented:
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.
0
 
Eric BourlandAuthor Commented:
>>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.
0
 
reitersCommented:
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
0
 
reitersCommented:
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
0
 
Eric BourlandAuthor Commented:
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
0
 
reitersCommented:
If you have host headers set to resolve the name and the site does not point to wwwroot default folder then you need to make a virtual directory to CFIDE in your site.
0
 
Eric BourlandAuthor Commented:
I think that is the problem. I am working on this.
0
 
Eric BourlandAuthor Commented:
Genius. That fixed it.

=)
0
 
Eric BourlandAuthor Commented:
Thank you reiters. This solved the problem. I shoulda known! =)

Eric B
0
 
reitersCommented:
Glad I could help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now