cfc

Return data using ColdFusion and jQuery Ajax

可紊 提交于 2019-12-23 03:54:15
问题 I'm making a request to a cfc file that queries a database. Do I store these results in a struct, array or some other way? And depending on how I store and return the results, how do I handle the pieces from jQuery? I tried storing the results in an array and only displaying one of the results like so, which did not work: $.ajax({ type: "POST", url: "/ajax/ajax_test.cfc?method=ajaxTest", data:"field1=17", success: function(response) { var r=response; $(".cat_vid_subContainer").empty(); $("

$.ajax ColdFusion cfc JSON Hello World

懵懂的女人 提交于 2019-12-23 01:44:05
问题 I've simplified this example as much as I can. I have a remote function: <cfcomponent output="false"> <cffunction name="Read" access="remote" output="false"> <cfset var local = {}> <cfquery name="local.qry" datasource="myDatasource"> SELECT PersonID,FirstName,LastName FROM Person </cfquery> <cfreturn local.qry> </cffunction> </cfcomponent> And using the jQuery $.ajax method, I would like to make an unordered list of everyone. <!DOCTYPE HTML> <html> <head> <script src="http://www.google.com

How do I reset application.cfc without resetting the server instance? [duplicate]

空扰寡人 提交于 2019-12-22 07:45:32
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: restart application without restarting server? How do I reset a Coldfusion Application / application.cfc without resetting the Coldfusion Server instance? If I remember right, there are a few tricks out there such as creating a reinit function within application.cfc or renaming the file. 回答1: A couple of steps: First, make sure all your application initialization logic is contained inside the OnApplicationStart

Mapping to a CFC in ColdFusion

旧巷老猫 提交于 2019-12-17 16:07:52
问题 In my application I have all my CFC's in a cfc folder. From the site root I can access them without any trouble by simply referring to them in my <cfinvoke> tag as component=cfc.mycomponent method=mymethod The trouble is, when I want to access the cfc from another page that's not in the root I can't use component=../.cfc.mycomponent to get in touch with that cfc. What am I doing wrong here? 回答1: There are a handful of options for getting this to work. Unfortunately, learning them has taken me

ColdFusion & Ajax: Error Invoking CFC

不问归期 提交于 2019-12-13 19:24:15
问题 I have tried multiple tutorials on this topic from Forta.com and yet run into the same error: "Error invoking CFC/....(file path)../wgn.cfc: Internal Server Error [Enable debugging by adding 'cfdebug to your URL parameters to see more info]" I am working on my local machine and testing as localhost. Running WinXP Pro with sp3. Using Coldfusion's web server. Both my .cfm and .cfc are in the same folder under the the webroot. In my case: c:\ColdFusion9\wwwroot\bridges(.cfm and .cfc here) So,

return variable undefined in jQuery $.post sent by a cfc

家住魔仙堡 提交于 2019-12-13 01:20:44
问题 I am using $.post() to send a json to my cfc, which updates some records. I am not returning a json back to the calling page, I am just returning the contents of a variable that I am setting in the cfc. Based on the value of that variable, the update was/was not successful. I cannot seem to get at the contents of the variable. I just started using jQuery, so I think I'm doing it right, but apparently not. the jQuery: $("#edit_button").click(function(){ if(theArray.length > 0){ theJson = JSON

JSON response from my CFC is retunring HTML code

走远了吗. 提交于 2019-12-12 17:20:40
问题 I have a strange issue here. I am making a call to a CFC using jquery and returning a string. I am then trying to populate a form field with that string. For some reason, my response is including HTML code along with the query results. Here is how the JSON response looks in the console: > Gary Turner check_out.cfm:146 Successfully ran JSON, now changing > input value check_out.cfm:149 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML > 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

Multi-application Coldfusion 7 server and CFC paths

坚强是说给别人听的谎言 提交于 2019-12-11 13:29:55
问题 We have a Coldfusion server that hosts multiple applications, all in their own subfolder. Something like: /webrootfolder/applicationA /webrootfolder/applicationB Furthermore, on the development server, we have a copy of a given application per developer, each being a Subversion working copy: /webrootfolder/applicationA_dev1 /webrootfolder/applicationA_dev2 /webrootfolder/applicationA_dev3 Since we are running Coldfusion 7 (with major resistance to upgrading), I find myself stuck as I want to

CFC JSON Output - Issue with displaying query results

独自空忆成欢 提交于 2019-12-11 08:47:04
问题 This is a long question - with a lot of detail - so first up apologies for that - but I'm not sure how to ask this in a briefer way. I have two CFC's, both are designed to return JSON from a query, and then I'm using jquery to display the results. The first CFC looks like this: <cfcomponent output="no"> <cffunction name="getRequests" access="remote" returntype="query"> <cfset var status = #arguments.status#> <run some query> <cfreturn getRequests> </cffunction> This is called and the result

Using a Coldfusion cfc how do you format return data for jqgrid dependent selects in the edit form?

拈花ヽ惹草 提交于 2019-12-11 07:28:47
问题 I am trying to figure out how to set up dynamic dependent selects. This is an edit of my original post to try to make it more readable and clear. I have included my whole grid in case it helps but it might be too much information. The grid displays perfectly. <!---stylesheets ---> <link rel="stylesheet" type="text/css" media="screen" href="jquery-ui-1.8.17.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="ui.jqgrid.css" /> <script src="jquery.js" type="text/javascript