cfc

How do I pass an edited Flex datagrid to a CFC to insert to a database

I have a datagrid which is editable and I need to send that back to the database via a CFC for insertion into the database after all the editing is complete. Dumping the array collection to cfdump tells me that I have an array with items and a structure but i cannot understand how to "loop" through each and insert into the DB. There see...

Staging my Coldfusion app when using CFC inheritance/extends

I have an application.cfc in a subdir of my webroot: /app/application.cfc I recently added another application.cfc in a subdir of that and it extends the original application.cfc using the proxy method described here http://corfield.org/blog/index.cfm/do/blog.entry/entry/Extending_Your_Root_Applicationcfc : /app/mysubdir/application....

Dynamic Variable Names Coldfusion

Hey Guys, I'm having a tad of an issue dealing with Dynamic Variable Names. What is happening is I have a CFC that builds part of form for me using some data in a table. Then the cfc sends the form's code back to the page as a string. Well I need to assign values to these form fields so people don't overwrite the data. I'm pulling the da...

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

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. ...

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 inside a contained function? Is it blocked from outside the cfc? (Examples in CF 8) Call...

Why does a long cfc file work in CF8, but not CF9? Getting "Branch target offset too large for short" error.

I have a fairly long cfc file, about 1800 lines long, that worked fine in ColdFusion 8, but after upgrading my development system to ColdFusion 9 and doing some testing I get a compile error for a cfc and the message says "Branch target offset too large for short". I modified the file to eliminate some unused functions and consolidated o...

How do I return JSON data using jQuery.post() to a Coldfusion 8 cfc?

How do I post a form using jQuery.post() to a Coldfusion.cfc method and return json data? Is there a certain way I need to format the url or form values in order to specify the cfc method to invoke remotely? How do I tell Coldfusion to return json data? I've searched the existing jQuery/Coldfusion.cfc questions and I'm looking for some ...

How do I run a static method on a CFC without using cfinvoke?

How do I invoke a static method on a CFC without using cfinvoke? I know that I can do this: <cfinvoke component="MyComponent" method="myStaticMethod' arg1="blah" returnvariable=myReturnVar> I would like to be able to invoke this method the same way I would a UDF: <cfset myReturnVar = MyComponent.myStaticMethod(blah)> This, however...

How can I work with a struct returned from a cfc in jquery

I have a cfc <cffunction name="addEditPerson" access="remote" returntype="struct"> a bunch of cfarguments <cfscript> var returnThis = structNew(); var error = ''; structInsert(returnThis,'success',0,true); structInsert(returnThis,'error','',true); structInsert(returnThis,'pers...

ColdFusion Server CFC Caching Issue

Hello, I develop coldFusion applications on my laptop with it's own ColdFusion 8 server with IIS which run on Windows Vista. I am having a rather annoying problem. The problem is whenever I make any changes to my CFC's, it appears that unless I restart my ColdFusion Application server, the changes to my CFC's will not take effect unti...

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 <cfthread> and I'm calling the garbage collector when memory dips below 50% (making sure to have 30 seconds between gc() calls to prevent the garbage collector from hogg...

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 that need access. This results in my creating of several CFC files that are identical. Is ...

How do I pass an argument to a CFC through AJAX?

Hello, I'm using the following scrip to call a CFC function: function loadQuery() { $.get('QueryData.cfc',{},function(GetMyData){ $("#content").html(GetMyData) }) return false } $(document).ready(function() { $("#loadLink").click(loadQuery) }); This is my HTML: <a href="" id="loadLink">Load It</a> <div ...

Coldfusion CFC creation taking a variable amout of time to execute.

I've been doing some logging of object creation times in our open account process in production. Periodically, initializing an object would take way longer than expected. By initializing I mean calling it's init() and passing a couple of arguments that may be simple variables or objects. e.g. <cfset validateObj = createObject("component...

Garbage collecting at ColdFusion CFC

Hello. 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 the object scope when invokation ended. It can be a bit dumb question for Java p...

Difficulty creating a paging function with MySQL and ColdFusion

I'm trying to create pagination for search results using MySQL and ColdFusion. My intention is to only retrieve the queries that can be displayed on a single page, thus making the process efficient. I tried using two queries in my function, but I could not return two variables to the cfinvoke. The following code does not paginate, but ...

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 is a decimal: {"PAGE":"My Page Title","ID":19382.0} Needed to update the following HTM...

In Coldfusion, how do I init a component that is located above the current path folder?

If I have a folder structure that looks like this: / /bin/myComponent.cfc /reports/index.cfm How do I initiate myComponent.cfc from index.cfm? myService = createObject("component", "bin.myComponent"); Using the dot syntax, I know how to go to deeper folders, but how to do I go up a folder, and down into the other folder? Using slas...

cfml error with application.cfc page

Hi, I have some problem with my cfml website. I have used the below code in application.cfc file to connect with the dsn. But when ever i put this in my server, i'm getting error. i cant browse even a single test.cfm page. Is there any mistake in that code , any syntax error or something like that, will it be some problem with the ds...

Calling overridden parent method from parent method

Heres the situation. Component B extends component A and overrides the init method to accept a different parameter. A also has a create method that calls init. If i have an instance of B and i call create, its calling the wrong init - it calls init in B, where i need it to call init in A. I dont want to call super.init() as there may n...