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

asked on

question about CFGRID

Hmm. Can't get CFGRID to do what it should. Here is the page: http://hwaet.com/comics.cfm

A grid should load, but it does not.

I think CFGRID does not find the script folder in /CFIDE/.

I read up on CFGRID in Forta's CF WACK 9 book (vol 1), and I think I am doing all I should -- obviously I am missing something, and I think I need to tell my application, comics.cfm, how to find the script folder. The cfajaximport tag does not seem to work for me.

What am I missing?

This is not an urgent task -- thanks for any advice. =)

Eric


<!--- Set the datasource --->
 <cfset ds="ebwebwork">
 
  <cfquery datasource="#ds#" name="GetComics">
  SELECT *
  FROM comics
  ORDER BY Issue ASC
  </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>Comics Data</title>
</head>

<body>

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


<cfform>


<cfgrid name="showComics"
format="flash"
width="1200"
height="1200"
autowidth="yes"
colHeaders="yes" 
rowheaders="yes"
collapsible="true"
query="GetComics" />


</cfform>





</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
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
SOLUTION
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
SOLUTION
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
here is a therad on adobe forums http://forums.adobe.com/thread/213595, read the 3rd post from bottom...
Avatar of Eric Bourland

ASKER

Good advice, all.

True -- I need to map a new virtual directory for CFIDE in IIS 7. I will do that.

I will try the HTML format (I've tried both Flash and HTML).

The query does return data and there is data in the data table.

I will work on this in the morning and let you know what happens. Thank you _agx_, brij, and gdemaria.

Eric B
To me it looks like your CFIDE folder may not be mapped.

Could very well be. But I'm surprised the grid works at all if that's the problem. Then again, it is flash ;-)
SOLUTION
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 mapped the /CFIDE/ directory to a virtual directory /wd40/ ...

http://hwaet.com/wd40/scripts/cfform.js

http://hwaet.com/wd40/scripts/cfformhistory.cfm

... now resolve in a browser.

I dumped my query"GetComics" and it does return data.

I changed CFGRID format to HTML per _agx_'s suggestion.

Per brij's suggestion I read the useful thread on the Adobe forums: http://forums.adobe.com/thread/213595:

I was running across a similar issues - the CFForm compiled into a flash form properly, but it was missing the data from both a CFGrid and a CFSelect that I was trying to feed via queries. Well, luckily I stumbled across a thread that stated that the root of the issue is a lack of proper mapping for the CFIDE directory on the server. I had the server Admin set up the mapping, and it works perfectly now.

... but I think my virtual directory /wd40/ maps correctly to Physical Path C:\ColdFusion9\wwwroot\CFIDE\

(According to my reading, this is not a security issue ... right? I simply opened IIS 7 and set up a virtual folder that maps to the physical path for CFIDE.)

CFGRID draws an outline of the grid, but omits the data. The dump is below the grid:

http://www.hwaet.com/comics.cfm

However, if I view source of comics.cfm, I do see the data in the source. Hum!

I wonder if there is a permissions problem on my Windows 2008 / IIS 7 server, that prevents execution of the scripts in C:\ColdFusion9\wwwroot\CFIDE\?

This is mainly just a curious problem for me; I have been doing a lot of reading about CFGRID and would like to get it to work.

Thank you again for your help.

E
<cfset ds="ebwebwork">
 
  <cfquery datasource="#ds#" name="GetComics">
  SELECT ID
        ,Title
        ,Volume
        ,Issue
        ,Publisher
        ,PublishDate
        ,CGCGrade
        ,PGXGrade
        ,Image
        ,Notes
  FROM comics
  ORDER BY Issue ASC
  </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>Comics Data</title>
</head>

<body>

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


<cfform>

            <cfgrid name="showComics"
            format="html"
            width="1200"
            height="1200"
            autowidth="yes"
            colHeaders="yes" 
            rowheaders="yes"
            collapsible="true"
            query="GetComics" />

</cfform>


<cfdump var="#GetComics#" expand="yes">


</body>
</html>

Open in new window

SOLUTION
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
SOLUTION
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
brij, thank you -- I saw the same error in MSIE 8.

I need to rely more on Firebug. Thank you for the links to the "Coldfusion is not defined" error ... looking into them now.

gdemaria, I thought I could name my virtual directory anything I chose as long as it referred to the correct folders and files in the physical directory ... but I did change the virtual folder name to /CFIDE/.

Per brij's suggestion I will work on the "Coldfusion is not defined" error.

Thank you all again. I will return here when I make more progress. Have a great evening.

Eric

p.s. I took a break tonight to apply the latest Adobe Hotfixes to my ColdFusion 8 and 9 servers -- that went well.
Eric, don't let brij confuse you.   You are simply missing the mapping of the CFIDE folder.   The "Coldfusionnot found" errors are a RESULT of that mapping not being in place.  You don't need to learn about all the problems caused by not having the mapping, you just need to put the mapping there.   If it does not work, let us know.

It needs to be called /CFIDE because the scripts are all referencing this path /CFIDE/scirpts so the the name is not /CFIDE they will not be found.
gdemaria, How I am confusing Eric, I don't understand, Coldfusion Not Found Errors are due to missing scripts mappings and that is what I have said and also the posts that I have posted links...

what is the confusion ??
I think there is a mapping problem going on. brijeshchauhan, I don't feel confused, and I am learning a ton. I always appreciate your input.

I read the two links that brijeshchauhan sent, and I also did some more reading about Coldfusion Is Undefined errors.

There are useful posts here:

http://forums.adobe.com/thread/134287?decorator=print&displayFullThread=true
http://forums.adobe.com/thread/50733 

that describe closely the problem I am having, though I use Windows 2008 Server and IIS 7.

The idea I get from these posts is, with correct mapping to /CFIDE/, the Coldfusion Is Undefined error resolves. I'd like to see why my current mapping to /CFIDE/ has not worked.

In IIS 7 when I set up the virtual folder /CFIDE/ under web site hwaet.com, and Test Settings, I get a warning that authorization fails. I attach three screencasts to show you what I mean.

I need to do some research about setting proper authorization for virtual directories.

I did not mean for this problem to drag on for so long. I really appreciate, as always, the ideas and guidance from gdemaria, _agx_, and brijeshchauhan.

 User generated image User generated image User generated image
And the current code I am using:
<cfset ds="ebwebwork">
 
  <cfquery datasource="#ds#" name="GetComics">
  SELECT ID
        ,Title
        ,Volume
        ,Issue
        ,Publisher
        ,PublishDate
        ,CGCGrade
        ,PGXGrade
        ,Image
        ,Notes
  FROM comics
  ORDER BY Issue ASC
  </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>Comics Data</title>
</head>

<body>

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


<cfform>

            <cfgrid name="showComics"
            format="html"
            width="1200"
            height="400"
            autowidth="yes"
            colHeaders="yes" 
            rowheaders="yes"
            collapsible="true"
            query="GetComics" />

</cfform>


</body>
</html>

Open in new window

I got it to work, partially, by editing the afajaximport tag:

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

http://www.hwaet.com/comics.cfm

I believe the CFIDE mapping on the server is correct and the authentication for the anonymous IUSR user is sufficient. I think the problem is with my cfajaximport.
It is working properly.

The problem was my cfajaximport code.

I'll close this question now. I really appreciate the guidance from gdemaria, brij, and _agx_.

I am glad I got CFGRID to work. Aside from working with CFML, my hobby is collecting high-grade, certified, classic "Star Wars" comics. It's nostalgia, but I am not sure if it goes under geekiness or nerdiness. This CFGRID is an easy way to review the data table I built to organize my collection.

For business purposes, it was very useful to understand CGFRID and cfajaximport. I am going to continue to experiment with CFGRID.

Thank you all again.

Eric
Thank you to gdemaria, brij, and _agx_.
The correct cfajaximport code (using a map to the default coldfusion9/wwwroot/CFIDE/ folder) is

<cfajaximport cssSrc="/CFIDE/scripts/ajax/"
    scriptSrc="/CFIDE/scripts/"
    tags="cftooltip, cfwindow, cfgrid">

Open in new window


...just as it recommends in the documentation. =)

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79fe.html
Eric, it should not have been necessary for you to add the cssSrc and scriptSrc attributes to your cfajaximport tag.  You specified the default locations, so you should not need to do that.   You should check the priviledges on the virtual directory.

Setting up the /CFIDE virtual directory was what was needed, if you got an error doing it, we should have addressed that issue, not sought out work-arounds.  

I thought the links that brij provided would be confusing because the first link, at least, contained a lot of discussion of people trying various solutions and didn't get to a matching resolution until the very end of a long thread.  This same resolution was already provided directly to you in a previous post, so it I thought it would only be confusing to go through all of that informaton when you already had the answer.



gdemaria,

>>>Setting up the /CFIDE virtual directory was what was needed, if you got an error doing it, we should have addressed that issue, not sought out work-arounds.  

I understand and I agree.

My misunderstanding was that the cfajaximport tag was required, and not just a workaround.

A little while after I posted my last post, I took away the cfajaximport tag completely, and found that the application works fine without the cfajaximport tag. Thus I think my mapping to /CFIDE/ is OK.

My problem before was caused by the presence of the cfajaximport tag pointing to the wrong folders.

I understand now that the cfajaximport tag is useful when the JavaScript files used by AJAX are not in the default location, or otherwise are not where the application should expect them to be.

Eric

> I understand now that the cfajaximport tag is useful when the JavaScript files used by AJAX are not in the default location, or otherwise are not where the application should expect them to be.

Yes, that is true for the use of the cssSrc and scriptSrc attributes

However, the more typical use of cfajaximport looks like this:

 <cfajaximport tags="cfgrid">

This is useful if you are calling cfwindow or cfdiv that contains the cfgrid.   Just want you to keep this in mind in case you need it in the future.  

Glad you got it working as it should be..