Copy link to clipboard
Copied
Hi everyone,
i have a little problem using the cfajaxproxy tag or any other tag using ajax.
here is a the code
<cfajaxproxy cfc="mdh.dev.test.proxy" jsclassname="proxy" />
function testFunction() {
var instance = new proxy();
instance.setCallbackHandler(functionSuccess);
instance.testing();
}
the result in the source will be:
<script type="text/javascript">
var _cf_proxy=ColdFusion.AjaxProxy.init('/dev/test/test/proxy.cfc','mdh.dev.test.proxy');
_cf_proxy.prototype.testing=function() { return ColdFusion.AjaxProxy.invoke(this, "testing", {});};
</script>
the " mdh " is a logical mapping in coldfusion admin and in IIS
i can't find why the url is trunked in the source result.
instead of being
var _cf_proxy=ColdFusion.AjaxProxy.init('/mdh/dev/test/test/proxy.cfc','mdh.dev.test.proxy');
it create
var _cf_proxy=ColdFusion.AjaxProxy.init('/dev/test/test/proxy.cfc','mdh.dev.test.proxy');
anyone else having this problem ?
tyvm
Copy link to clipboard
Copied
Have you found the answer for your question? I am running into the same problem. Thx!
Copy link to clipboard
Copied
It's very likely a path problem. Verify, using
<cfset testObject=createobject("component","mdh.dev.test.proxy")>
<cfdump var="#testObject#">
Then you will know whether the path is correct.
Copy link to clipboard
Copied
I have a related question:
<cfset testObject=createobject("component","mdh.dev.test.proxy")>
what values for createobject() would I use if my testing server is
http://192.168.1.128:8500/mdh/dev/proxy.cfc
and my file, under windows, is located at: C:\ColdFusion8\wwwroot\mdh\dev\test\proxy.cfc ?
what values for createobject() would I use if my testing server is
http://192.168.1.128:8500/mdh/dev/proxy.cfc
and my file, under windows, is located in a different folder: C:\ColdFusion8\wwwroot\mdh\CFCs\proxy.cfc ?
Thanks
Copy link to clipboard
Copied
dgleneck@ndi-inc.org wrote:
> my file, under windows, is located in a different folder: C:\ColdFusion8\wwwroot\mdh\CFCs\proxy.cfc ?
You already know the location of your file, which is mdh.CFCs.proxy in dotted notation. That was possibly the problem in the original post.
Copy link to clipboard
Copied
I completely forgot to try to createObject, & dump the object. I ran into a strange variable-scope conflict because of this!
I had a cfajaxproxy tag on my page which had worked fine at first.
I made some changes and ColdFusion started giving me the "CFC does not exist" PATHING error message, when in fact it was a scope issue that made itself visible when I dumped the object onto the page, giving me a message like "the variable OPTIONS already exists, use the local scope".
I apparently already had a variable called "options" on the page my proxy was running on and bingo, I'd just created a variable "options" inside my CFC method like this:
<cfset var options = DeserializeJSON(arguments.options)>
Turns out I was DOING IT WRONG, and the var needed it to be in the LOCAL scope, like so:
<cfset var local.options = DeserializeJSON(arguments.options)>
Now ColdFusion actually doesn't throw this strange pathing error message. Just wanted to share this issue in the hopes that it could help others!