House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

cfgrid bind component path not working

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
09/06/2008 01:42 PM

I experimenting with binding an HTML cfgrid to a CFC and I'm having troubles.   <cfgrid format="html" name="grd_list_users" bind="cfc:com.myapp.www.DAOs.userDAO.getAllUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"> The cfc is web-accessible in the following path:   www.myserver.com/com/myapp/www/DAOs/userDAO.cfc The docs say: "The componentPath value must be a dot-delimited path from the web root or the directory that contains the current page." However, when the page loads, I get this error in my cfdebug window: http: Error invoking CFC /userDAO.cfc : Not Found ColdFusion seems to just be chopping off all those directories and simply looking for the CFC in the web root.  Why the heck would it do that? I can't find anything in the docs that explain it, and what is killing me is EVERY single example I can find always just uses the cfc in the web root, or in the same location as the main file.  It's the curse of the abundance of over-simplified examples...  I must be missing something obvious. ~Brad

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
09/07/2008 12:25 AM

An update:  This does work if I use the following syntax: bind="url:/com/myapp/www/DAOs/userDAO.CFC?method=getAllUsers&etc... I never did figure out how to use the "cfc:" syntax since Ajax calls that CF created kept looking in the root folder for the CFC. I would still like someone to explain that one to me. ~Brad ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Azadi Saryev
09/07/2008 12:56 AM

is any of the directories in the path to your cfc a CF mapping or a virtual dir? i had trouble binding to components in a virtual dir path - had to move them to a dir physically under web root... and components in a cf mapped dir do not bind. Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Brad Wood wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
09/07/2008 01:00 AM

They are not virtual directories.  They are bona fide, honest-to-goodness directories. ~Brad > is any of the directories in the path to your cfc a CF mapping or a > virtual dir? > i had trouble binding to components in a virtual dir path - had to move > them to a dir physically under web root... and components in a cf mapped > dir do not bind.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Azadi Saryev
09/07/2008 01:04 AM

hmm... can;t recall now if you must have access="remote" set in the function you are binding to or not... Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Brad Wood wrote: > They are not virtual directories.  They are bona fide, honest-to-goodness > directories. > > ~Brad

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
09/07/2008 01:08 AM

Yeah, you do.  It throws an error if you don't. Here's the thing though-- the whole access of the function/CFC doesn't even come into play if your Ajax call can't find it in the first place. I am telling CF exactly where my CFC is, but CF is ignoring the component path I give it and creating JavaScript that attempts to find the CFC in the web root like so: /userDAO.cfc ~Brad > hmm... can;t recall now if you must have access="remote" set in the > function you are binding to or not...

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Azadi Saryev
09/07/2008 01:16 AM

strange indeed... where is you calling page located in relation to the path you specify to your cfc? Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Brad Wood wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
09/07/2008 01:20 AM

It is located in the root directory:  /index.cfm I think that might be why it is looking there even though it doesn't make sense. What is funny is that I KNOW ColdFusion understands the component path, because if I misspell anything, I get a runtime CF error that it couldn't find the component.  Yet, as soon as CF begins generating the cfgrid stuff, it seems to forget.  Nowhere in any of the docs have I found a statement saying "Your CFC must be in the same directory as the calling page." ~Brad > strange indeed... where is you calling page located in relation to the > path you specify to your cfc?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Azadi Saryev
09/07/2008 01:36 AM

Brad Wood wrote: > Nowhere in any of the docs have I found a statement > saying "Your CFC must be in the same directory as the calling page." > > ~Brad >   > it does not have to be in the same dir, that's for sure. i just ran some quick tests and was able to bind a grid to a cfc no matter where i put it, or where the calling page was located in relation to it... so something else must be at play here... some sort of caching maybe? Azadi


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists