0

I have been unable to get Railo to work with a new CFC on a test page and keep getting a "Railo is not defined" in the Error Console

The Error Console highlights this section:

   var _Railo_proxytest = Railo.ajaxProxy.init('/proxytest.cfc','proxytest');

Code CFC:

<cfcomponent>

   <cffunction name="test1" access="remote" returntype="string" output="no">
   <cfargument name="name" type="string" required="yes" default="Nameless">
   <cfreturn "#areguments.name#">
   </cffunction>
</cfcomponent>

Code CFM:

<cfajaxproxy cfc="proxytest" jsclassname ="proxytest">
<script>

var myProxy = new proxytest();

function runProxy() {
var name = document.getElementById("name").value;
var results = myProxy.sayHello(name);
}
</script>


<form>
  <input type="text" id ="name">
  <input type="button" onclick="runProxy()" value="Run">
</form>
Jeromy French
  • 11,812
  • 19
  • 76
  • 129
user1009749
  • 63
  • 3
  • 8

2 Answers2

0

Try like this:

var proxytest = Railo.ajaxProxy.init('/proxytest.cfc');
Andrea Campolonghi
  • 546
  • 2
  • 5
  • 15
0

You've got a typo in your example code: <cfreturn "#areguments.name#"> should be <cfreturn "#arguments.name#">

Also, the code you posted doesn't add up. You are calling function sayHello() from Javascript, but the CFC does not have this function. It is usually wise to post the actual code, instead of a rewrite.

What happens if you call /proxytest.cfc?method=test1&name=MyName directly from the browser?

Perception
  • 79,279
  • 19
  • 185
  • 195