Search Results

Search found 65 results on 3 pages for 'cfc'.

Page 1/3 | 1 2 3  | Next Page >

  • cfml error with application.cfc page

    - by tibin mathew
    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 dsn <cfset this.name = "0307de6.netsolhost.com"> <cfset this.sessionmanagement = true> <cfset this.loginstorage="session"> <cfset this.sessiontimeout = CreateTimeSpan(0,0,30,0)> <cfset this.applicationtimeout = CreateTimeSpan(2,0,0,0)> <cffunction name="onApplicationStart"> <cfscript> application.DSN = "hirerodsn"; application.dbUserName = "myusr"; application.dbPassword = "myd69!"; </cfscript> </cffunction> <cffunction name="onRequestStart"> <cfscript> request.DSN = "hirerodsn"; request.dbUserName = "myusr"; request.dbPassword = "myd69!"; </cfscript> </cffunction> please anyone help me

    Read the article

  • Call to CFC via Ajax-POST does not work

    - by Philipp
    We have the following problem: A CFC-method that is called from AJAX suddenly redirects the request to cfcexplorer instead of executing the request. The strange thing is, that the problem only occurs when we make the ajax call via "POST" method, like this: // This will return the HTTP Status header: // Location: http://url.to:80/CFIDE/componentutils/cfcexplorer.cfc?method=getcfcinhtml&name=web.ajax&path=/web/ajax.cfc $.post( "http://url.to/ajax.cfc", {method: "test"}, function(res) { alert("ajax.cfc POST return:" + res); } ); Making the same request as "GET" request works perfectly: // This will call the method "test" of web/ajax.cfc $.get( "http://url.to/ajax.cfc", {method: "test"}, function(res) { alert("ajax.cfc GET return:" + res); } ); This is the ajax.cfc file (dummy file): <cfcomponent> <cffunction name="test" access="remote" returntype="Any" returnformat="JSON"> <cfset j = {}> <cfset j.data = "this is the data"> <cfreturn serializeJson(j)> </cffunction> </cfcomponent> What really puzzles us is that the request did work in the past (we have a lot of code all making ajax calls via POST and CF-code that expects FORM-data to be present, so we cannot simply change the method to GET) Maybe there was some setting that has changed or similar...

    Read the article

  • Is it more efficient (Performance) to store the CFC in application variables OR instance the CFC on the page call?

    - by Mitchell Guimont
    Hello, I'm working on a ColdFusion dynamic website. For this website, there are a lot of CFCs and a lot of functions within each CFC. Would it be more efficient to store an instance of the CFC in an application variable, then to instance each CFC separately on each page load. For each page, at most 2 separate CFCs get called. I'm also interested in how performance will be effected when requests increase (Stress). Thanks!

    Read the article

  • ColdFusion CFC implementation of C# Partial Class?

    - by Brian David Berman
    Does ColdFusion offer a mechanism for splitting CFCs into multiple files? I am NOT talking about extension, I am talking about splitting the SAME CFC into multiple files; the same way C# allows for "partial" classes. The reason for this is because I am using T4 to generate a bunch of CFCs and I want to be able to tag functionality onto the generated CFC by doing so in another file. I want to do this in a way that doesn't violate the Open-Closed Principle.

    Read the article

  • Garbage collecting at ColdFusion CFC

    - by Sergii
    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 people, but I'd like to know how Java garbage collector cleans up the CFC methods memory: only when whole request ends, or maybe right after each method/function invokation? Second option is interesting because it can allow me to split my large method into the few, as one of the possible optimizations.

    Read the article

  • Flex RemoteObject Intermittently Failing to Invoke CFC

    - by Justin
    I have a Flex app that uses Flash Remoting and the RemoteObject to pull data from a ColdFusion CFC. About 75% of the time it works, but the other times I get a message using Charles (a debugging tool) that says faultString = "Unable to Invoke CFC". FaultCode = "Server.Processing". Here's my RemoteObject: The server set up on our web farm is to use load balancing. I'm not sure if this is causing the problem or not. Probably not, but it's a thought. Any help is appreciated!!

    Read the article

  • Huge performance difference between two web servers, odd behavior seen using process monitor

    - by Francis Gagnon
    We have two Coldfusion servers that have a huge performance difference running the exact same code on the exact same input data. The code in questions instantiates a large amount of CFCs (Coldfusion Components, which are similar to objects in OOP languages). I compared the two servers by running Process Monitor and then calling the problematic code on both machines. I learned two things. First, Coldfusion opens CFC files every time it instantiates an object. Both servers do this, so it cannot be the cause of the performance difference. Second, the fast server opens the CFC files directly while the server with the performance problem seems to navigate its way through the path until it reaches the desired CFC file. It does this for every file, even the ones it has previously loaded, and because the code instantiates so many CFCs it becomes very slow. See below the partial Promon traces that show this behavior. It can take over 60 seconds for the slow server to do what the fast one does in 2 seconds. Can anyone tell me what causes this behavior? Is it a Coldfusion setting? Since Coldfusion runs on top of Java, is it a Java setting? Is it an OS option? The fast server is running Windows XP and I think the slow server is a Windows Server 2003. Bonus question: Coldfusion doesn't seem to perform any READ FILE operations on any of the CFC or CFM files. How can this be? Sample of the fast server opening CFC files: 11:25:14.5588975 jrun.exe QueryOpen C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5592758 jrun.exe CreateFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5595024 jrun.exe QueryBasicInformationFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5595940 jrun.exe CloseFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5599628 jrun.exe CreateFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5601600 jrun.exe QueryBasicInformationFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc 11:25:14.5602463 jrun.exe CloseFile C:\CF\wwwroot\APP\com\HtmlUtils.cfc Equivalent sample of the slow server opening CFC files: 11:15:08.1249230 jrun.exe CreateFile D:\ 11:15:08.1250100 jrun.exe QueryDirectory D:\org 11:15:08.1252852 jrun.exe CloseFile D:\ 11:15:08.1259670 jrun.exe CreateFile D:\org 11:15:08.1260319 jrun.exe QueryDirectory D:\org\cli 11:15:08.1260769 jrun.exe CloseFile D:\org 11:15:08.1269451 jrun.exe CreateFile D:\org\cli 11:15:08.1270613 jrun.exe QueryDirectory D:\org\cli\cpn 11:15:08.1271140 jrun.exe CloseFile D:\org\cli 11:15:08.1279312 jrun.exe CreateFile D:\org\cli\cpn 11:15:08.1280086 jrun.exe QueryDirectory D:\org\cli\cpn\APP 11:15:08.1280789 jrun.exe CloseFile D:\org\cli\cpn 11:15:08.1291034 jrun.exe CreateFile D:\org\cli\cpn\APP 11:15:08.1291709 jrun.exe QueryDirectory D:\org\cli\cpn\APP\com 11:15:08.1292224 jrun.exe CloseFile D:\org\cli\cpn\APP 11:15:08.1300568 jrun.exe CreateFile D:\org\cli\cpn\APP\com 11:15:08.1301321 jrun.exe QueryDirectory D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1301843 jrun.exe CloseFile D:\org\cli\cpn\APP\com 11:15:08.1312049 jrun.exe CreateFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1314409 jrun.exe QueryBasicInformationFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1314633 jrun.exe CloseFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1315881 jrun.exe CreateFile D:\ 11:15:08.1316379 jrun.exe QueryDirectory D:\org 11:15:08.1316926 jrun.exe CloseFile D:\ 11:15:08.1330951 jrun.exe CreateFile D:\org 11:15:08.1338656 jrun.exe QueryDirectory D:\org\cli 11:15:08.1339118 jrun.exe CloseFile D:\org 11:15:08.1526468 jrun.exe CreateFile D:\org\cli 11:15:08.1527295 jrun.exe QueryDirectory D:\org\cli\cpn 11:15:08.1527989 jrun.exe CloseFile D:\org\cli 11:15:08.1531977 jrun.exe CreateFile D:\org\cli\cpn 11:15:08.1532589 jrun.exe QueryDirectory D:\org\cli\cpn\APP 11:15:08.1533575 jrun.exe CloseFile D:\org\cli\cpn 11:15:08.1538457 jrun.exe CreateFile D:\org\cli\cpn\APP 11:15:08.1539083 jrun.exe QueryDirectory D:\org\cli\cpn\APP\com 11:15:08.1539553 jrun.exe CloseFile D:\org\cli\cpn\APP 11:15:08.1544126 jrun.exe CreateFile D:\org\cli\cpn\APP\com 11:15:08.1544980 jrun.exe QueryDirectory D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1545482 jrun.exe CloseFile D:\org\cli\cpn\APP\com 11:15:08.1551034 jrun.exe CreateFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1552878 jrun.exe QueryBasicInformationFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc 11:15:08.1553044 jrun.exe CloseFile D:\org\cli\cpn\APP\com\HtmlUtils.cfc Thanks

    Read the article

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

    - by Dan Sorensen
    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 HTML: <a href="page.cfm?id=19382" id="pagelink">My Page Title</a> Conceptually, I suppose there are multiple answers: 1) I could use jQuery to grab the number left of the decimal point. 2) I could force Coldfusion to send the number as a string. 3) I could generate the whole link server side and just replace the whole link tag HTML (not the preferred answer, but maybe it is the best) Does anyone know how to do 1 or 2? Is 3 better? Relevant Javascript: (Not optimized) $(".link").live('click', function () { var $linkID, serviceUrl; serviceUrl = "mycfc.cfc?method=getPage"; $linkID = $(this).attr("rel"); $.post(serviceUrl, { linkid: $linkID }, function (result) { $('#pagelink').val(result.TITLE); if (result.FMKEY.length) { // NEED the ID number WITHOUT the .0 at the end $('#pagelink').attr("href") = "page.cfm?id=" + result.ID; $('#pagelink').text(result.TITLE); } }, "json"); }); My CFC: <component output="no"> <cfsetting showdebugoutput="no"> <cffunction name="getPage" access="remote" returnFormat="JSON" output="no" hint="Looks up a Page Title and ID"> <cfargument name="linkID" type="string" required="yes"> <cfset var page = queryNew("id,title")> <cfset var result = structNew()> <cfquery datasource="myDatasource" name="page"> SELECT TOP 1 id, title FROM pages WHERE linkID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.linkID#"> </cfquery> <cfif page.recordcount> <cfset result.id = page.id> <cfset result.title = page.title> </cfif> <cfreturn result> </cffunction> </component>

    Read the article

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

    - by Bazza
    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", "compExample").init( productionMode = VARIABLES.productionMode, ipWhiteListed = isWhiteListed, ipLocatorObj = VARIABLES.ipLocatorObj ) /> Thats all that happens in init() methods. Generally the execution time would be 0ms, but at random times I might get 3 or 3.5 seconds. This is not specific to one particular server or to our generally busy period. It appears to be quite random. One thought was that these templates were being evicted from our template cache as they are not especially frequently used, although I checked cfstat on a number of servers and the max CP/Sec is -1. Running CF 8,0,1 Has anybody else ever come across this?

    Read the article

  • Find who's calling the method

    - by Marcos Placona
    Hi, I'd like to somehow find out which CFC is calling my method. I have a logging CFC which is called by many different CFC's. On this logging CFC there's a need to store which CFC called for the log. Whilst I could simply pass the CFC name as an argument to my log.cfc, I find this to be a repetitive task, that might not be necessary, if I somehow could find out "who's" calling the method on log.cfc Is there any programmatic way of achieving this? Thanks in advance

    Read the article

  • $.ajax ColdFusion cfc JSON Hello World

    - by cf_PhillipSenn
    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/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1"); </script> <script type="text/javascript"> jQuery(function($){ $.ajax({ url: "Remote/Person.cfc?method=Read&ReturnFormat=json", success: function(data){ var str = '<ul>'; // This is where I need help: for (var I=0; I<data.length; I++) { str += '<li>' + I + data[I][1]+ '</li>' } str += '</ul>'; $('body').html(str); }, error: function(ErrorMsg){ console.log("Error"); } }); }); </script> </head> <body> </body> </html> The part where I'm lost is where I'm looping over the data. I prefer to the use jQuery $.ajax method because I understand that $.get and $.post don't have error trapping. I don't know how to handle JSON returned from the cfc.

    Read the article

  • cfml error with appication.cfc page

    - by tibin mathew
    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 dsn <cfset this.name = "0307de6.netsolhost.com"> <cfset this.sessionmanagement = true> <cfset this.loginstorage="session"> <cfset this.sessiontimeout = CreateTimeSpan(0,0,30,0)> <cfset this.applicationtimeout = CreateTimeSpan(2,0,0,0)> <cffunction name="onApplicationStart"> <cfscript> application.DSN = "hirerodsn"; application.dbUserName = "myusr"; application.dbPassword = "myd69!"; </cfscript> </cffunction> <cffunction name="onRequestStart"> <cfscript> request.DSN = "hirerodsn"; request.dbUserName = "myusr"; request.dbPassword = "myd69!"; </cfscript> </cffunction> please anyone help me

    Read the article

  • Passing the form scope to a Remote cfc

    - by cf_PhillipSenn
    What is the syntax for passing the form scope into a cfc with access="remote"? I have: <cfcomponent> <cfset Variables.Datasource = "xxx"> <cffunction name="Save" access="remote"> <cfset var local = {}> <!--- todo: try/catch ---> <cfif arguments.PersonID> <cfquery datasource="#Variables.Datasource#"> UPDATE Person SET FirstName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,LastName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> WHERE PersonID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.PersonID#"> </cfquery> <cfset local.result = arguments.PersonID> <cfelse> <cfquery name="local.qry" datasource="#Variables.Datasource#"> INSERT INTO Person(FirstName,LastName) VALUES( <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.FirstName#"> ,<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.LastName#"> ); SELECT PersonID FROM Person WHERE PersonID=Scope_Identity() </cfquery> <cfset local.result = local.qry.PersonID> </cfif> <cfreturn local.result> </cffunction> </cfcomponent> I need to pass in form.PersonID, form.firstname, form.lastname.

    Read the article

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

    - by Dan Sorensen
    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 slash syntax it would be something like this: ../bin/myComponent.cfc But createObject() doesn't work that way. I'd like to keep a relative path so that I can move this folder to another server without breaking the paths. Ideas? Thanks!

    Read the article

  • error : java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy anyone know about this ?

    - by faheem
    Hi does anyone know about this error I get when I try to insert a foreign key value in my entry entity using cf9 Hibernate ? java.lang.ClassCastException: java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy Root cause :org.hibernate.HibernateException: java.lang.ClassCastException: java.lang.String cannot be cast to coldfusion.cfc.CFCBeanProxy Below is the code for my entity object and then for my user object.. Is there anything wrong with this ? entry.cfc /** * Entries Object */ component output="false" persistent="true"{ property name="entry_id" fieldType="id" generator="uuid"; property name="entryBody" ormType="text"; property name="title" notnull="true" type="string"; property name="time" fieldtype="timestamp"; property name="isCompleted" ormType="boolean" dbdefault="0" default="false"; property name="userID" fieldtype="many-to-one" fkcolumn="userID" cfc="user"; Entry function init() output=false{ return this; } } user.cfc /** * Users Object */ component output="false" persistent="true"{ property name="userID" fieldType="id" generator="uuid"; property name="firstName" notnull="true" type="string"; property name="lastName" notnull="true" type="string"; property name="password" notnull="true" type="string"; property name="userType" notnull="true" type="string"; //property name="entry" fieldtype="one-to-many" type="array" fkcolumn="userID" cfc="entry"; User function init() output=false{ return this; } }

    Read the article

  • combobox dataprovider

    - by FALCONSEYE
    I have the following: <mx:RemoteObject id="myCFC" destination="ColdFusion" source="components.myCFC" showBusyCursor="true"> <mx:method name="getStuff" result="UserHandler(event);"/> </mx:RemoteObject> ... <mx:ComboBox id="propertyCode" dataProvider="{qry_stuff}" labelField="name" /> Index.as has: [Bindable] public var qry_stuff:ArrayCollection = new ArrayCollection; private function UserHandler(event:ResultEvent):void { qry_stuff= event.result as ArrayCollection; } public function init():void { /* call my remote Object to get my data */ myCFC.getStuff(); } my problem is the combobox displays [object Object] I know there is nothing wrong with the cfc and there is a field called "name" in getStuff. Why does it not display the value of the object? thanks in advance.

    Read the article

  • CFfile -- value is not set to the queried data

    - by user494901
    I have this add user form, it also doubles as a edit user form by querying the data and setting the value="#query.xvalue#". If the user exists (eg, you're editing a user, it loads in the users data from the database. When doing this on the <cffile field it does not load in the data, then when the insert goes to insert data it overrights the database values with a blank string (If a user does not input a new file). How do I avoid this? Code: Form: <br/>Digital Copy<br/> <!--- If null, set a default if not, set the default to database default ---> <cfif len(Trim(certificationsList.cprAdultImage)) EQ 0> <cfinput type="file" required="no" name="cprAdultImage" value="" > <cfelse> File Exists: <cfoutput><a href="#certificationsList.cprAdultImage#">View File</a></cfoutput> <cfinput type="file" required="no" name="cprAdultImage" value="#certificationsList.cprAdultImage#"> </cfif> Form Processor: <!--- Has a file been specificed? ---> <cfif not len(Trim(form.cprAdultImage)) EQ 0> <cffile action="upload" filefield="cprAdultImage" destination="#destination#" nameConflict="makeUnique"> <cfinvokeargument name="cprAdultImage" value="#pathOfFile##cffile.serverFile#"> <cfelse> <cfinvokeargument name="cprAdultImage" value=""> </cfif> CFC ARGS: <cfargument name="cprAdultExp" required="NO"> <cfargument name="cprAdultCompany" type="string" required="no"> <cfargument name="cprAdultImage" type="string" required="no"> <cfargument name="cprAdultOnFile" type="boolean" required="no"> Query: UPDATE mod_StudentCertifications SET cprAdultExp='#DateFormat(ARGUMENTS.cprAdultExp, "mm/dd/yyyy")#', cprAdultCompany='#Trim(ARGUMENTS.cprAdultCompany)#', cprAdultImage='#Trim(ARGUMENTS.cprAdultImage)#', cprAdultOnFile='#Trim(ARGUMENTS.cprAdultOnFile)#' INSERT INTO mod_StudentCertifications( cprAdultExp, cprAdultcompany, cprAdultImage, cprAdultOnFile

    Read the article

  • Coldfusion "Routines cannot be declared more than once"

    - by Nicholas
    We have the following code in our Application.cfc: <cffunction name="onError" returnType="void" output="false"> <cfargument name="exception" required="true"> <cfargument name="eventname" type="string" required="true"> <cfset cfcatch = exception> <cfinclude template="standalone/errors/error.cfm"> </cffunction> Within the error.cfm page we have this code (I didn't write it): <cfscript> function GetCurrentURL() { var theURL = "http"; if (cgi.https EQ "on" ) theURL = "#TheURL#s"; theURL = theURL & "://#cgi.server_name#"; if(cgi.server_port neq 80) theURL = theURL & ":#cgi.server_port#"; theURL = theURL & "#cgi.path_info#"; if(len(cgi.query_string)) theURL = theURL & "?#cgi.query_string#"; return theURL; } </cfscript> This is all part of a script that puts together bunches of details about the error and records it to the database. When an error occurs, we receive the message "The routine GetCurrentURL has been declared twice in different templates." However, I have searched the entire codebase in several different ways and found "GetCurrentURL" used only twice, both times in error.cfm. The first time is the declaration, and the second is actual use. So I'm not sure why CF is saying "in different templates". My next thought was that the problem is a recursive call, and that error.cfm is erroring and calling itself, so I attempted these two changes, either of which should have resolved the issue and unmasked the real error: <cfif StructKeyExists(variables,"GetCurrentURL") IS "NO"> <cfscript> function GetCurrentURL() { var theURL = "http"; if (cgi.https EQ "on" ) theURL = "#TheURL#s"; theURL = theURL & "://#cgi.server_name#"; if(cgi.server_port neq 80) theURL = theURL & ":#cgi.server_port#"; theURL = theURL & "#cgi.path_info#"; if(len(cgi.query_string)) theURL = theURL & "?#cgi.query_string#"; return theURL; } </cfscript> </cfif> And: <cfscript> if (!StructKeyExists(variables,"GetCurrentURL")) { function GetCurrentURL() { var theURL = "http"; if (cgi.https EQ "on" ) theURL = "#TheURL#s"; theURL = theURL & "://#cgi.server_name#"; if(cgi.server_port neq 80) theURL = theURL & ":#cgi.server_port#"; theURL = theURL & "#cgi.path_info#"; if(len(cgi.query_string)) theURL = theURL & "?#cgi.query_string#"; return theURL; } } </cfscript> Neither worked. I also tried adding this to the page just before the function call: <cfoutput>"#StructKeyExists(variables,"GetCurrentURL")#"</cfoutput> It caused the word "YES" to be printed on screen. This indicates that the above should work, as clearly the contents of the if statement will evaluate to "YES", and thus the if statement will evaluate to false, and thus the function will not be declared, and thus I will retain my sanity. But for some reason this problem persists. Any thoughts on what might be occuring or how to troubleshoot next? I'm stuck at this point.

    Read the article

  • Difficulty creating a paging function with MySQL and ColdFusion

    - by Mel
    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 it displays the result search results using a CFC: <!---DEFINE DEFAULT STATE---> <cfparam name="variables.searchResponse" default=""> <cfparam name="URL.titleName" default=""> <cfparam name="URL.genreID" default=""> <cfparam name="URL.platformID" default=""> <!---TitleName can only be blank if one or both genre and platform are selected---> <cfif StructKeyExists(URL, "searchQuery") AND (Len(Trim(URL.titleName)) LTE 2 AND Len(URL.genreID) IS 0 AND Len(URL.platformID) IS 0)> <cfset variables.searchResponse = "invalidString"> <cfelseif StructKeyExists(URL, "searchQuery")> <cfinvoke component="gz.cfcomp.test" method="searchGames" returnvariable="resultData" argumentcollection="#URL#"> <cfset variables.searchResponse = "hasResult"> </cfif> <cfif searchResponse EQ "hasResult" AND resultData.RecordCount EQ 0> <cfset variables.searchResponse = "noResult"> </cfif> Using this logic, I can display what I need to display on the page: <cfif searchResponse EQ "invalidString"> <cfoutput>Invalid search</cfoutput> </cfif> <cfif searchResponse EQ "noResult"> <cfoutput>No results found</cfoutput> </cfif> <cfif searchResponse EQ "hasResult"> <cfoutput>Display Results</cfoutput> </cfif> If I were executing the queries on the same page, it would be easy to follow the many tutorials out there. But the queries are executing in a function. Displaying the data is easy, but paginating it has become a nightmare for me. Here is my function: <cffunction name="searchGames" access="public" output="false"> <cfargument name="titleName" required="no" type="string"> <cfargument name="genreID" required="no" type="string"> <cfargument name="platformID" required="no" type="string"> <!--- DEFINE LOCAL VARIABLES---> <cfset var resultData = ""> <!---GET DATA---> <cfquery name="resultData" datasource="myDSN"> SELECT * <!---JOINS FOR GENRE/PLATFORM GO HERE---> WHERE <!---CONDITIONS GO HERE---> </cfquery> <!---RETURN VARIABLE---> <cfreturn resultData> </cffunction> To paginate, I thought about modifying my function to the following (a new query using a count statement): <!--- DEFINE LOCAL VARIABLES---> <cfset var resultCount = ""> <!---GET DATA---> <cfquery name="resultCount" datasource="myDSN"> SELECT COUNT(gameID) AS rowsFound FROM GAMES <!---JOINS FOR GENRE/PLATFORM GO HERE---> WHERE <!---CONDITIONS GO HERE---> </cfquery> <!---RETURN VARIABLE---> <cfreturn resultCount> Then I figured if there is a result to return, I would execute a nested query and create the pagination variables: <cfif resultCount.rowsFound GTE 0> <cfparam name="pageNumber" default="1"> <cfset var recordsPerPage = 5> <cfset var numberOfPages = Int(resultCount.RecordCount / recordsPerPage)> <cfset var recordsToSkip = pageNumber * recordsPerPage - recordsPerPage> <!---DEFINE LOCAL VARIABLE---> <cfset var resultData = ""> <cfquery name="resultData" datasource="myDSN"> <!---GET DATA AND SEND IT BACK USING LIMIT WITH #recordsToSkip# and #RecordsPerPage#---> </cfquery> <!---RETURN VARIABLE---> <cfreturn resultData> </cffunction> I figured I would return two variables: resultCount and resultData. I would use #resultCount# to build my pagination, and #resultData# to display the output. The problem is I can't return two variables in the same cfinvoke tag. Any ideas of how to approach the the right way? I'm totally lost as to the logic I need to follow.

    Read the article

  • Calling overridden parent method from parent method

    - by Yisroel
    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 not always be a super. Is there any way to specify to call the init in the parent component?

    Read the article

  • How do I get Dreamweaver to deploy syntax highlighting for full script CFC's?

    - by Mel
    Is there a way to get Dreamweaver CS4 to use syntax highlighting when writing full script CFCs? If the document type is .cfc and they syntax is fullscript, there is no syntax highlighting; the code will be in black text... For example, the following block of code will appear without syntax highlighting: component extends="whatever" output="false" { public void foo() { } } While the tag equivalent would be highlighted normally: <cfcomponent extends="whatever" output="false"> <cffunction name="foo" returnType="void" access="public"> </cffunction> </cfcomponent>

    Read the article

  • Can I load the max value of the range attribute in CFINPUT using and AJAX call?

    - by Eric Belair
    I have a CFINPUT tag in a CFFORM: <cfinput type="text" id="itemInput" name="itemInput" /> I want to set the range dynamically without posting the page. I have several AJAX calls throughout the page to dynamically load form fields on the fly: <cfselect id="this" name="this" bind="cfc:Data.getThis()" bindonload="true" /> <cfselect id="that" name="that" bind="cfc:Data.getThat({p1})" /> <cfselect id="theOther" name="theOther" bind="cfc:Data.getTheOther({p1}, {p2})" /> <cfdiv id="maxQty" bind="cfc:Data.getMaxQty({itemId})" /> <cfinput type="text" id="qty" name="qty" /> <cfdiv id="itemId" bind="cfc:Data.getItemId({this}, {that}, {theOther})" /> In the above CFFORM, I basically want to set the minValue of the range to "1" and the maxValue of the range to the value of cfc:Data.getMaxQty({itemId}). Is this possible? How can I do it?

    Read the article

  • What is the proper way to assign a general udf to application.cfc?

    - by Tom Hubbard
    I simply want to define a function in application.cfc and expose it application wide to all requests. Preferably the "assignment" would only happen on application startup. Is the preferred method to do something along the lines of this: <CFCOMPONENT OUTPUT="FALSE"> <CFSET this.name = "Website"> <CFSET this.clientManagement = true> <CFSET this.SessionManagement = true> <CFFUNCTION NAME="GetProperty" OUTPUT="False"> <CFARGUMENT NAME="Property"> <CFRETURN this.Props[Property]> </CFFUNCTION> <CFFUNCTION NAME="OnApplicationStart" OUTPUT="FALSE"> <CFSET Application.GetProperty = GetProperty> . . . or is there something better?

    Read the article

  • How do I unhide a CFDIV that has dynamic content with AJAX binding itself?

    - by Eric Belair
    I have the following CFSELECT tags that are used to populate a text input: <cfselect id="this" name="this" bind="cfc:Data.getThis()" bindonload="true" /> <cfselect id="that" name="that" bind="cfc:Data.getThat({p1})" /> <cfselect id="theOther" name="theOther" bind="cfc:Data.getTheOther({p1}, {p2})" /> The text input is the only value that needs to be submitted in a form: <cfform name="addItem" method="post" action="somepage.cfm"> <cfinput type="text" id="item" name="item" bind="cfc:Data.getResult({this}, {that}, {theOther})" /><br /> <cfinput type="submit" name="addButton" value="Add Item" /> </cfform> I want the form and it's contents to be visible only when all three selections have been made, and there is a value for the text input. What is the best way to do this? I'm assuming some use of CFDIV is the best way, but I'm not sure how to load the dynamic content (the CFINPUTs) this way.

    Read the article

  • CF9 HQL Statement for many-to-many and Multiple Criteria

    - by Jeremy Battle
    I have the following setup: Listing.cfc component persistent="true" { property name="ListingId" column="ListingId" type="numeric" ormtype="int" fieldtype="id" generator="identity"; ... property name="Features" type="array" hint="Array of features" singularname="Feature" fieldtype="many-to-many" cfc="Feature" linktable="Listing_Feature" FKColumn="ListingId" inversejoincolumn="FeatureId"; } Feature.cfc component persistent="true" table="Feature" schema="dbo" output="false" { property name="FeatureId" column="FeatureId" type="numeric" ormtype="int" fieldtype="id" generator="identity"; property name="FeatureDescription" column="FeatureDescription" type="string" ormtype="string"; ... /*property name="Listings" fieldtype="many-to-many" cfc="Listing" linktable="Listing_Feature" fkcolumn="FeatureId" inversejoincolumn="ListingId" lazy="true" cascade="all" orderby="GroupOrder";*/ } I can select all listings that have a particular feature using: <cfset matchingListings = ormExecuteQuery("from Listing l left join l.Features as feature where feature.FeatureId = :feature",{feature = 110}) /> Which is fine, however, I'd like to be able to select all listings that have multiple features (for example a listing that has both "Dishwasher" AND "Garage") After a couple hours of googling and looking through hibernate documentation haven't been able to find a solution that won't give me an error. My guess is that the solution is pretty simple and I am just over-thinking it...anyone have any suggestions?

    Read the article

1 2 3  | Next Page >