Solved

question about CFGRID

Posted on 2011-02-24
23
1,287 Views
Last Modified: 2012-08-14
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

0
Comment
Question by:Eric Bourland
  • 10
  • 6
  • 5
  • +1
23 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 84 total points
ID: 34976036
The code works ok for me. Are you sure the query contains data?

<cfgrid format="flash"

If you have a choice, go with HTML format instead.  If you use flash forms you'll have to use actionscript, not javascript.  Plus html forms are the norm these days. So you'll find more support for them.
0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 250 total points
ID: 34976545

To me it looks like your CFIDE folder may not be mapped.  Or at least when I try to access it, the server is not responding.

Perhaps you need to map IIS with a new virtual directory for CFIDE and point it to the folder
0
 
LVL 11

Assisted Solution

by:Brijesh Chauhan
Brijesh Chauhan earned 166 total points
ID: 34976729
Are you trying to import the CFIDE scripts from a different server ??

http://67.59.134.9/CFIDE/scripts/ajax/resources/ -- if you open this in a browser, it gives 403 access error, you need a correct mapping of CFIDE ...
0
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 34976733
here is a therad on adobe forums http://forums.adobe.com/thread/213595, read the 3rd post from bottom...
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34976789
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
0
 
LVL 52

Expert Comment

by:_agx_
ID: 34976794
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 ;-)
0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 250 total points
ID: 34976836

Yeah, this would come up if the CFIDE is mapped

http://www.hwaet.com/CFIDE/scripts/cfform.js

Could be multiple issues of course.


Brijech, brings up the IP address, but didn't test it correctly.  That IP address DOES work at this..

  http://67.59.134.9/CFIDE/scripts/cfform.js

So that means you have sites on the server that are mapped correctly, but the hwaet.com site does not have the mapping


0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34984860
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

0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 250 total points
ID: 34985511
You need to call the virtual directory CFIDE, not wd40  

The scripts are looking for /CFIDE/scripts.... so calling it wd40 won't work

0
 
LVL 11

Assisted Solution

by:Brijesh Chauhan
Brijesh Chauhan earned 166 total points
ID: 34985873
Eric, you can check for erros that you are getting using FIREBUG, I checked your website, and you are MISSING the mappping, check the screen shot attached, you will find error which says COLDFUSION IS NOT DEFINED, which is due to the missing scripts mappings
Untitled.png
0
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 34985884
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 3

Author Comment

by:Eric Bourland
ID: 34985927
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.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 34987767
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.
0
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 34988039
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 ??
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34988332
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.

 I believe I have mapped /CFIDE/ correctly in IIS7 Setup of the virtual directory is easy, but.... .... it looks like there might be a problem with Windows authorization.
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34988428
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

0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34988938
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.
0
 
LVL 3

Author Comment

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

Author Closing Comment

by:Eric Bourland
ID: 34989009
Thank you to gdemaria, brij, and _agx_.
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34989106
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
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 34990114
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.



0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 34990155
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
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 34990168

> 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..
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

15 Experts available now in Live!

Get 1:1 Help Now