interacting with coldfusion component functions

6 views
Skip to first unread message

sli...@gmail.com

unread,
May 9, 2008, 3:12:18 PM5/9/08
to mxAjax
So, I've been trying to call a function from inside a cfc using
myAjax, but the information returned in the response variable looks
like text from a full wddx packet. Here is the first bit of text:

<wddxPacket version="1.0"><header><data><struct
type="coldfusion.runtime.TemplateProxy">...

is this trying to return the entire object or whats the deal? How do i
call a cfc function? The examples are nice, but its not any
replacement for some good documentation which I have not been able to
find. Anyway, here is my code. Its a modification of one mxData1.cfm
file.

<script language="javascript">
var url = "/examples/facade/ajaxFacade.cfc";

function init() {
new mxAjax.Data({
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:"tags=local news,sports",
cffunction:"getContent"}),
postFunction: handleData
});

function handleData(response) {
document.getElementById('test').innerHTML = response;
}
}

addOnLoadEvent(function() {init();});
</script>

Arjun....@gmail.com

unread,
May 9, 2008, 6:46:34 PM5/9/08
to mxAjax
Can you also post the code for "getContent()" function

sli...@gmail.com

unread,
May 12, 2008, 9:14:55 AM5/12/08
to mxAjax
<cffunction name="getContent" access="remote" output="false"
returntype="query">
<cfargument name="tags" type="string" required="true">
<cfset VARIABLES.contentGateway =
CreateObject('component','model.model.dataobjects.contentGateway').init()>
<cfreturn VARIABLES.contentGateway.getContent(tags=ARGUMENTS.tags)>
</cffunction>

I tried access=public, but that gave me an error saying access needs
to be remote.
Reply all
Reply to author
Forward
0 new messages