coldfusion-9

Struckt Key Exists in cfqueryparam?

送分小仙女□ 提交于 2019-12-24 11:37:14
问题 I have form fields with checkbox fields. On my cfc page I would like to use strucktKeyExists to check if checkbox form fields exist when I run my Insert/Update query. Also I have null attribute in my cfqueryparam that will set value to true/false if value/field doesn't exist. Here is example of my code: dm_ck0 = <cfqueryparam value="#trim(structKeyExists(FORM, 'frm_ck0'))#" cfsqltype="cf_sql_bit" maxlength="1" null="#yesNoFormat(!len(trim(structKeyExists(FORM, 'frm_ck0'))))#" /> So when I

Changing cfform values with javascript for dynamic bind output

别等时光非礼了梦想. 提交于 2019-12-24 10:48:36
问题 CFM <html> <head> <title>Test Page</title> <script type="text/javascript"> function toggleV(value){ document.getElementById('blah').value = value; } </script> </head> <body> <cfform name="coolfrm"> <cfinput type="hidden" name="blah" id="blah" value="default"> <a onclick="toggleV('anothervalue')" style="cursor:pointer;">click Me</a> </cfform> <cfdiv bind="cfc:TestCFC.func({coolfrm:blah})"></cfdiv> </body> </html> CFC <cfcomponent> <cfscript> remote function func(simpleString){ return

Should I always need to use cflock with SESSION scope variables?

大城市里の小女人 提交于 2019-12-24 08:39:31
问题 I have a simple Form , which on submission sets a variable in SESSION like <cfset SESSION.shownote = 1> After firing an confirmation Email to the user , I am just deleting this variable from the Session. <cfset structdelete(SESSION,"shownote")> Do I really need to user cflock in this case ? I can not think of a Race condition here. As SESSION varies from one user to another , Can anyone please suggest me exactly on which situation we should use cflock with session variables? I have also heard

Getting distinct values in a column in orm

五迷三道 提交于 2019-12-24 08:12:36
问题 I can pull data via <cfquery name="keyTypeGroup"> SELECT DISTINCT keyTypeGroup FROM data.keyType </cfquery> I can pull all the data via orm ... return EntityLoad("data_KeyType"); ... I have tied <cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.KeyType', true)#"> But I get Error while executing the Hibernate query. org.hibernate.hql.ast.QuerySyntaxException: data.KeyType is not mapped [SELECT DISTINCT KeyGroupType FROM data.KeyType] How should I approach fixing this? 回答1:

Coldfusion Scopes Clarification

ε祈祈猫儿з 提交于 2019-12-24 06:53:58
问题 I have been reading about the CF Scopes, and am comfortable with the CFC scopes and their implications (detailed here), however, whenever I search for CF scopes it almost always references in the context of a CFC - So I was hoping for some clarification around scopes in CFM pages. I am working with CF 9/10 so only really interested in how the scopes behave in these releases. What scopes are available on a CFM page - do CFM pages have the same concurrency problems as can happen elsewhere, or

Coldfusion Scopes Clarification

喜夏-厌秋 提交于 2019-12-24 06:53:36
问题 I have been reading about the CF Scopes, and am comfortable with the CFC scopes and their implications (detailed here), however, whenever I search for CF scopes it almost always references in the context of a CFC - So I was hoping for some clarification around scopes in CFM pages. I am working with CF 9/10 so only really interested in how the scopes behave in these releases. What scopes are available on a CFM page - do CFM pages have the same concurrency problems as can happen elsewhere, or

Is it possible to have dynamically generated query names in ColdFusion?

限于喜欢 提交于 2019-12-24 04:58:51
问题 What I am trying to do is <cfloop array="#LOCAL.someArray" index="LOCAL.aString"> <cfset LOCAL.queryName = "uniqueQueryName_" & LOCAL.aString /> <cfquery name="#LOCAL.queryName#" datasource="db" cachedwithin="#CreateTimeSpan(1,0,0,0)#"> SELECT count(*) AS c FROM someTable </cfquery> <cfdump var="#LOCAL.queryName#" /> </cfloop> is this possible, or is there a better way to do it? Edit This works with <cfloop query="LOCAL.queryName"> but not when I try to do <cfset ArrayAppend(LOCAL.returnArray

ColdFusion Access Manager Error when attempting to clear trusted cache

耗尽温柔 提交于 2019-12-24 02:13:45
问题 <cfscript> if (isDefined("url.clearTrustedCache")) { clearTrustedCache(); } function clearTrustedCache() { adminObj = createObject("component","cfide.adminapi.administrator"); adminObj.login("admin"); runtimeObj = createObject("component","cfide.adminapi.runtime"); runtimeObj.clearTrustedCache(); } </cfscript> I am trying to use the above code to clear the trusted cache via URL param. I am getting the following error message: The current user is not authorized to invoke this method The only

CFExecute not executing appcmd.exe

核能气质少年 提交于 2019-12-24 00:57:51
问题 I created the following code on a Cofdfusion server: file name: testWebsite.cfm <cfoutput> <cfset exec_command = "add site /name:""demosite"" /bindings:http://demosite.testserver.com:80 /physicalpath:""D:\Websites\demosite"" "> <cfexecute name="C:\Windows\System32\inetsrv\appcmd.exe" arguments="#exec_command#" timeout="60" /> Done! </cfoutput> But when I execute this file e.g. http://www.demoserver.com/testcases/testWebsite.cfm It just displays "Done!" without any errors, it doesn't execute

Differences between New/CreateObject() vs EntityNew() in CF9 for persistent CFC?

纵然是瞬间 提交于 2019-12-23 19:13:41
问题 What are the differences (if any) between New/CreateObject() to create an object vs EntityNew() to create an entity in CF9 for persistent CFC? 回答1: With New() and CreateObject() you need to specify the full path to the CFC. With EntityNew() you just need to pass in the name of the entity. 回答2: quoted from: Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject() I actually asked this question during the "Advanced ORM" session at CFUNITED and got a slightly different answer.