|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfgrid bind component path not working
I experimenting with binding an HTML cfgrid to a CFC and I'm having troubles.Brad Wood 09/06/08 01:42 P An update: This does work if I use the following syntax:Brad Wood 09/07/08 12:25 A is any of the directories in the path to your cfc a CF mapping or aAzadi Saryev 09/07/08 12:56 A They are not virtual directories. They are bona fide, honest-to-goodnessBrad Wood 09/07/08 01:00 A hmm... can;t recall now if you must have access="remote" set in theAzadi Saryev 09/07/08 01:04 A Yeah, you do. It throws an error if you don't.Brad Wood 09/07/08 01:08 A strange indeed... where is you calling page located in relation to theAzadi Saryev 09/07/08 01:16 A It is located in the root directory: /index.cfmBrad Wood 09/07/08 01:20 A Brad Wood wrote:Azadi Saryev 09/07/08 01:36 A 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 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 ----- 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 ----- 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. 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 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... 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 ----- 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? 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
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||