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.

458 questions
8
votes
3 answers

Is output=false by default for cfscript function in CFC?

I thought CFC's methods defined as functions in cfscript are output=false by default, but when I open the CFC in cfcexplorer.cfc (browser directly to the CFC), it says Output: enabled. cfcexplorer.cfc's Bug?
Henry
  • 31,972
  • 19
  • 112
  • 214
8
votes
3 answers

How do I store CFCs in a separate directory and make them work?

Is there a way to specify the component path in the tag? I am using ColdFusion Components for my application. My application has several folders, however, and each time I want a CFC to work, I have to save it in the same directory as those files…
Mohamad
  • 32,727
  • 31
  • 131
  • 208
7
votes
4 answers

How to call a function dynamically that is part of an instantiated cfc, without using Evaluate()?

For example I want to be able to programatically hit a line of code like the following where the function name is dynamically assigned without using Evaluate(). The code below of course doesn't work but represents what I would like to…
Dan Roberts
  • 4,455
  • 2
  • 31
  • 42
7
votes
3 answers

coldfusion weird extra space

I have a function to convert string to number
tsurahman
  • 1,762
  • 5
  • 16
  • 25
7
votes
4 answers

In a Coldfusion cfc, what is the scope name for variables set outside of a function?

In a Coldfusion component / CFC, I want to properly scope some variables to be available for all contained functions, but to be hidden or blocked from outside scripts. What is the name of the cfc's memory scope? Is it 'variables'? Is that available…
Dan Sorensen
  • 10,465
  • 18
  • 65
  • 98
6
votes
6 answers

How to protect access="remote" functions in CFCs from snoopers?

One of the great features of CFCs is the ability to reuse the code for both a straight .cfm page and for Flex apps. One such app that I devleoped uses Flex for its charting capabilities and needs access to a 'getResults()' function in the cfc. All…
Chris Brandt
  • 938
  • 2
  • 11
  • 21
6
votes
4 answers

Is it possible to test an object against a component type and/or inherited type?

Update: Based on the answers I initially went the route of using IsInstanceOf() which was designed for this need. However it turned out to be extremely inefficient for some unknown reason. In debugging the app later I ended up just setting some…
Dan Roberts
  • 4,455
  • 2
  • 31
  • 42
6
votes
4 answers

JSON returned from remote CFC function is out of order

I have a remote CFC that returns a structure. It is called using cfajaxproxy. I want the JSON returned to be in order i.e. first into the structure first into the JSON object. However, the JSON that is returned is in a mixed up order. Here's the…
Brandon
  • 232
  • 2
  • 10
6
votes
2 answers

How to Dynamically write implicit getters and setters in ColdFusion/Lucee Components?

I want to be able to dynamically write a set of getters and setters in CFML/LUCEE components ( No hardcoded cfproperty tags).
edam
  • 818
  • 7
  • 30
6
votes
1 answer

How can one get a list of all queries that have run on a page in ColdFusion 9

I would like to add some code to my Application.cfc onRequestEnd function that, if a certain application variable flag is on, will log query sql and execution time to a database table. That part is relatively easy, since ColdFusion returns the sql…
6
votes
5 answers

CFC extends sibling folder

I've seen all kinds of solutions for extending cfcs in parent folders with access to parent files or the CF administration, but I have not seen a workable solution to extend a cfc in a "shared"/sibling folder without access to parent folders. This…
Andir
  • 2,027
  • 1
  • 15
  • 22
6
votes
1 answer

SQL Server Profiler not showing SQL statements embedded in ColdFusion components

In our ColdFusion 11 app with SQL Server 2008 R2. A .cfm file is using a CF component that is called with a syntax such as: objMyTable = createobject('component','components.myTable); qmyTable2list =…
nam
  • 15,516
  • 23
  • 104
  • 228
6
votes
2 answers

Memory implications of returning a query from a CFC

I've written a database load script in ColdFusion and I'm having a problem that the script slowly runs out of memory. I've split each table load into its own thread with and I'm calling the garbage collector when memory dips below 50%…
stomcavage
  • 979
  • 11
  • 27
6
votes
3 answers

Coding conventions for writing cfc's in CF9?

With the new ways of writing CFC in CF9, what are some of the coding convention new to CF9? Here are some I can think of... always use LOCAL scope always include init() method that returns itself, since New will call init() if found. do not put…
Henry
  • 31,972
  • 19
  • 112
  • 214
6
votes
3 answers

Concurrency and scoping issues when CFM is included from within a CFC

I am placing a component in my application scope so that it is shared across all requests and it includes a a cfm template:
Stuart Wakefield
  • 5,894
  • 20
  • 34
1
2
3
30 31