Questions tagged [cfc]

ColdFusion Components (CFCs) are objects in the ColdFusion environment. They are a collection of functions and properties.

ColdFusion Components (CFCs) are objects in the environment.

A component method is invoked in the following ways:

  • In the <cfinvoke> tag (Transient objects)

  • In the <cfobject> tag

  • In a URL that calls a CFC file and passes a method name as a URL parameter

  • By using createobject() in <cfscript> or in <cfset>

  • via web services

  • From code

Unlike normal ColdFusion files, CFCs have a .cfc extension.

463 questions
4
votes
5 answers

How do I force a Coldfusion cfc to output numeric data over JSON as a string?

I'm calling a Coldfusion component (cfc) using jQuery.post(). I need an integer or string representation of the number returned for use in a URL. {"PAGE":"My Page Title","ID":19382} or {"PAGE":"My Page Title","ID":"19382"} Instead what I get back…
Dan Sorensen
  • 11,403
  • 19
  • 67
  • 100
4
votes
2 answers

Garbage collecting at ColdFusion CFC

I have a CFC as singletone object in Application scope. One of the methods is used for massive data processing and periodically causes the "Java heap space" errors. EDIT All variables inside the method are VAR-scoped, so they should not be kept in…
Sergey Galashyn
  • 6,946
  • 2
  • 19
  • 39
4
votes
1 answer

"The specified CFC search could not be found"

We had our own server working with an app. We started hosting with a different provider and now we are getting the above-mentioned error. On the same page, this works:
4
votes
0 answers

Extra white-space and slashed double quotes when return from cfc angularJS

I am trying to preload some data using the angular-ui-router resolve method. I am getting the data back from my cfc, but the data being return isn't in a correctly formatted JSON. Here is the actual data, just junk data right now. Also the white…
Rob M
  • 1,007
  • 2
  • 17
  • 38
4
votes
4 answers

Should I Use CFINCLUDE or CFSAVECONTENT inside CFC

It seems like the standard MVC approch (as it relates to ColdFusion) is to make the view files .cfm and do a CFINCLUDE inside of the cfc that ultimately processes the view. Does this break the Object Orientation of cfc's? Does this cause the CFML…
Tom Hubbard
  • 15,820
  • 14
  • 59
  • 86
4
votes
2 answers

Which is better for UDFs: CFC vs CFM

I've several logically-related UDFs in a single file in my application. The question is that should the single file be a CFC file or a CFM file? and Why? I've referred to several links as below but they explain more about how to go about…
Crash OR
  • 327
  • 1
  • 3
  • 14
4
votes
3 answers

Function local variables in cfc

Having not worked with coldfusion before I was asked to look into some strange intermittent bugs in a coldfusion application. After reading about scopes I believe the problem is because none of the variables in my cfc functions are using the var…
Omiron
  • 341
  • 3
  • 15
4
votes
3 answers

Coldfusion CFC Return JSON display in Jquery, how do I handle multiple records from CFC and display in Jquery?

I need a way to grab the json return from coldfusion and display it in jquery I can display the first result fine, but if more that one record comes back I am stuck Here is my cfc In this query I can…
user1253239
  • 199
  • 2
  • 3
  • 13
3
votes
2 answers

returning multiple stored procedure result sets from a cfc

I am trying to convert some pages from my app to use cfc's, and one page uses a stored procedure to retrieve a couple sets of data. Now when I access the results, they act just like a if I used a tag, and all of the functionality that…
Rob M
  • 1,007
  • 2
  • 17
  • 38
3
votes
1 answer

Naming conventions for service wrapper cfc's in Coldfusion MVC

I have an application that handles licence registrations for various product. I'm currently re-factoring into a basic MVC framework (not using any of the big ones yet). We have various basic scenario's e.g. someone can make a cc purchase of a…
heartygooner
  • 43
  • 1
  • 4
3
votes
2 answers

Can you set a default value for an argument in a remote CFC function?

The ColdFusion 8 documentation states the following about the "required" attribute of CFARGUMENT: "All arguments are required when invoked as a web service, irrespective of how they are defined." However, I don't want ColdFusion to throw an…
Eric Belair
  • 10,574
  • 13
  • 75
  • 116
3
votes
2 answers

How can I use/access SESSION variables in a remote method of a ColdFusion CFC?

I have several methods in CFCs that are accessed remotely via JavaScript. Some of these methods use SESSION variables to determine what logic to run, and thereby, what data to return. For instance, let's say I set a SESSION variable upon login…
Eric Belair
  • 10,574
  • 13
  • 75
  • 116
3
votes
3 answers

Flex ColdFusion CFC location

I'm a ColdFusion developer looking to break into Flex. I have a couple test Flex applications Ii'm working on, but am having problem connecting to my CFCs. I've tried: creating mappings in CFAdmin, putting the CFC in the same folder as the Flex…
Gene R
  • 1,555
  • 5
  • 19
  • 32
3
votes
1 answer

ColdFusion ORM cannot find CFCs when using virtual directory

I have some entities with relationships: component name="Store" persistent="true" { property name="Products" fieldtype="one-to-many" cfc="Product"; } component name="Product" persistent="true" { property name="Store" fieldtype="many-to-one"…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
3
votes
0 answers

Coldfusion index.cfm page load firing twice and causing 404 Error

Trying to record "Page Loads" for custom CMS. On page load, I invoke a CFC that saves page and user information. Works on interior pages but not Homepage. Every "Homepage Click" records a "visit" to the homepage and then immediately records a link…