Solved

CFGRID will not display

Posted on 2010-09-21
19
835 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
  • 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
 
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now