Solved

CFGRID will not display

Posted on 2010-09-21
19
843 Views
Last Modified: 2012-05-10
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
Comment
Question by:Eric Bourland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 9
19 Comments
 
LVL 6

Expert Comment

by:reiters
ID: 33730974
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731058
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731140
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
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
LVL 6

Expert Comment

by:reiters
ID: 33731141
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731146
I have my own server with root access.
0
 
LVL 6

Expert Comment

by:reiters
ID: 33731147
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
 
LVL 6

Expert Comment

by:reiters
ID: 33731159
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731194
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
 
LVL 6

Expert Comment

by:reiters
ID: 33731358
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
 
LVL 6

Expert Comment

by:reiters
ID: 33731427
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731486
>>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
 
LVL 6

Expert Comment

by:reiters
ID: 33731563
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
 
LVL 6

Expert Comment

by:reiters
ID: 33731588
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731669
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
 
LVL 6

Accepted Solution

by:
reiters earned 500 total points
ID: 33731681
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
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731753
I think that is the problem. I am working on this.
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 33731767
Genius. That fixed it.

=)
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 33731768
Thank you reiters. This solved the problem. I shoulda known! =)

Eric B
0
 
LVL 6

Expert Comment

by:reiters
ID: 33731792
Glad I could help
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question