[ACFUG Discuss] Embedded CF in Javascript
This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
Re: [ACFUG Discuss] Embedded CF in Javascript
We would need to see the code that the error is referring to.TeddyOn 8/21/06, McTure, Greg [EMAIL PROTECTED] wrote: This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - -- cf_payne /Blog: http://cfpayne.wordpress.com/Atlanta CFUG: http://www.acfug.org - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
RE: [ACFUG Discuss] Embedded CF in Javascript
The query does exist and specifically it is the very first piece of code on the page. Ive sent the code and the CFLOOP is simply to loop through the query return of major categories to populate a dependent secondary drop down with the corresponding sub-categories. Again, this works without error on three CFMX boxes which is why I suspect it may be a CF5 issue with something in the JavaScipt/CFML mix of code. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Arehart Sent: Monday, August 21, 2006 10:37 AM To: discussion@acfug.org Subject: RE: [ACFUG Discuss] Embedded CF in _javascript_ Also, by embedded CFML code in _javascript_ do you mean simply CFML code that's building _javascript_ in a .cfm template. In that case, it doesn't really matter if it's creating JS or HTML. The error just reflects a problem in the code or config. That said, I can't say I've ever seen cannot set default query to xxx. I see it's saying it's in a loop. As Teddy says, seeing the code will be interesting. It's also just saying that a query named Category doesn't exist. Does it? /charlie http://www.carehart.org/blog/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teddy Payne Sent: Monday, August 21, 2006 10:14 AM To: discussion@acfug.org Subject: Re: [ACFUG Discuss] Embedded CF in _javascript_ We would need to see the code that the error is referring to. Teddy On 8/21/06, McTure, Greg [EMAIL PROTECTED] wrote: This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - -- cf_payne / Blog: http://cfpayne.wordpress.com/ Atlanta CFUG: http://www.acfug.org - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
Re: [ACFUG Discuss] group count ability
In practice, I've not seen using count(1) instead of count(*) to make any actual difference. It may be how our databases are configured (Oracle 9i). We're moving to 10g soon, so I'm looking forward to see if that makes a difference. I would encourage you to test and compare the two before just changing your code.Scott C.On 8/18/06, Fennell, Mark P. [EMAIL PROTECTED] wrote:OT point of clarity... The select count(*) as my_total from my_table in oracle reads every column of every row. For performance, it is recommended that you use select count(1) as my_total from my_table since that's not actually reading data but does more of a row-level existence check. Additionally, since you are not actually selecting data, the row count can be read from the table's statistics if they've been generated recently. If you are running oracle, you may also want to look into the cube() and rollup() group by functions for tallying group stats. Hope that helps.mfmark fennell, ocp dbaathens regional medical centerathens, ga-This email is intended only for the named recipient(s).It may contain information that is proprietary, confidential or otherwise prohibited from disclosure.If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it.If you have received this message in error, please reply immediately by email or telephone me at 706-475-4357 and delete all copies of the message. --Original Message-From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]]On Behalf Of Douglas KnudsenSent: Thursday, August 17, 2006 11:07 PMTo: discussion@acfug.orgSubject: Re: [ACFUG Discuss] group count ability what DB?If on Oracle you can add a column to your query called say countofcolumntogroupby populated by using a aggregate function as a analytic functionCOUNT(*) OVER (PARTITION BY columntogroupby ) AS countofcolumnttogeroupby no grouping needed here on the SQL side.Does SQLServer have a similar thing?nice faq on this herehttp://orafaq.com/node/55DKOn 8/17/06, Seth Tepfer [EMAIL PROTECTED] wrote:When doing a group on a query, is there a simple way to identify the number of rows in each group/section? That is, rather than prerunning over the query and setting up an array or structure. Perhaps something built in, even? If not, is this something worth asking for? cfoutput Query'=MyQueryName Group=ColumnToGroupByMy Section Title- there will #x# rows in this sectioncfoutputA single rowbr/cfoutput My section footer - there were #x# rows in this section/cfoutputOxford College Information Technology (OCIT)Now providing the same great service ina new building with the same telephones and email OCIT House603 Emory Street-To unsubscribe from this list, manage your profile @http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink---Douglas Knudsenhttp://www.cubicleman.comthis is my signature, like it? -To unsubscribe from this list, manage your profile @http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink--To unsubscribe from this list, manage your profile @ http://www.acfug.org?falogin.edituserformFor more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/List hosted by http://www.fusionlink.com- - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
RE: [ACFUG Discuss] Embedded CF in Javascript
Also, by "embedded CFML code in _javascript_" do you mean simply CFML code that's building _javascript_ in a .cfm template. In that case, it doesn't really matter if it's creating JS or HTML. The error just reflects a problem in the code or config. That said, I can't say I've ever seen "cannot set default query to xxx". I see it's saying it's in a loop. As Teddy says, seeing the code will be interesting. It's also just saying that a query named "Category" doesn't exist. Does it? /charlie http://www.carehart.org/blog/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teddy PayneSent: Monday, August 21, 2006 10:14 AMTo: discussion@acfug.orgSubject: Re: [ACFUG Discuss] Embedded CF in _javascript_ We would need to see the code that the error is referring to.Teddy On 8/21/06, McTure, Greg [EMAIL PROTECTED] wrote: This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - -- cf_payne /Blog: http://cfpayne.wordpress.com/Atlanta CFUG: http://www.acfug.org - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
RE: [ACFUG Discuss] Embedded CF in Javascript
Nope, that's a good perspective to have, Dusty. I had in fact asked the same question in a reply to the list, but it's just not yet been received for some reason. /charlie http://www.carehart.org/blog/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dusty HaleSent: Monday, August 21, 2006 10:21 AMTo: discussion@acfug.orgSubject: RE: [ACFUG Discuss] Embedded CF in _javascript_ Not sure if this is a great answer and I am sure some of the more experienced ACFUGers may have a better answer. _javascript_ is usually done on the client side so I dont believe it is even possible to embedd CFML code into _javascript_. Someone please correct me here if I am wrong. The error below leads me to believe that you might just try renamming the query or possibly that the cfloop is trying to loop through a query named CATEGORY which may not exist. Possibly the name CATEGORY is reserved. Dont know if this help or hurts but may be worth a shot. Best of luck. Dusty From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of McTure, GregSent: Monday, August 21, 2006 9:56 AMTo: discussion@acfug.orgSubject: [ACFUG Discuss] Embedded CF in _javascript_ This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
Re: re[2]: [ACFUG Discuss] Embedded CF in Javascript
If you want to use JS files with CF, I would recommend not changing the mapping of .js. I would rename file.js to file.js.cfm and then use cfinclude template=pathToFile/file.js.cfm in the head tag. That way CF will generate the text to add whatever dynamic driven elements you are looking for your JS. TeddyOn 8/21/06, Mischa Uppelschoten ext 10 [EMAIL PROTECTED] wrote: If you're using .js files, have you mapped the .js extension to the CF engine?Have you tried changing the name of the query to something that you know can never be a reserved word? /mThe query does exist and specifically it is the very first piece of code on the page.Ive sent the code and the CFLOOP is simply to loop through the query return of major categories to populate a dependent secondary drop down with the corresponding sub-categories.Again, this works without error on three CFMX boxes which is why I suspect it may be a CF5 issue with something in the JavaScipt/CFML mix of code. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Charlie ArehartSent: Monday, August 21, 2006 10:37 AMTo: discussion@acfug.orgSubject: RE: [ACFUG Discuss] Embedded CF in _javascript_Also, by embedded CFML code in _javascript_ do you mean simply CFML code that's building _javascript_ in a .cfm template. In that case, it doesn't really matter if it's creating JS or HTML. The error just reflects a problem in the code or config. That said, I can't say I've ever seen cannot set default query to xxx. I see it's saying it's in a loop. As Teddy says, seeing the code will be interesting. It's also just saying that a query named Category doesn't exist. Does it? /charliehttp://www.carehart.org/blog/From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Teddy PayneSent: Monday, August 21, 2006 10:14 AMTo: discussion@acfug.orgSubject: Re: [ACFUG Discuss] Embedded CF in _javascript_We would need to see the code that the error is referring to. TeddyOn 8/21/06, McTure, Greg [EMAIL PROTECTED] wrote:This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5?The code I have works as intended in CFMX but I get the following error on CF5?Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated.Thanks in advance. Error Diagnostic InformationCannot set default query to CATEGORYA query by this name is not available at this timeThe error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). -To unsubscribe from this list, manage your profile @http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink---cf_payne /Blog: http://cfpayne.wordpress.com/ Atlanta CFUG: http://www.acfug.org-To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserformFor more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/List hosted by FusionLink- Mischa UppelschotenThe Banker's Exchange, Inc. 2020 Hills Avenue NWAtlanta, GA30318Phone:(404) 605-0100 ext. 10Fax:(404) 355-7930Web:www.BankersX.comFollow this link for Instant Web Chat: http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN-To unsubscribe from this list, manage your profile @ http://www.acfug.org?falogin.edituserformFor more info, see http://www.acfug.org/mailinglistsArchive @ http://www.mail-archive.com/discussion%40acfug.org/List hosted by http://www.fusionlink.com- -- cf_payne /Blog: http://cfpayne.wordpress.com/Atlanta CFUG: http://www.acfug.org - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
RE: [ACFUG Discuss] Embedded CF in Javascript
Many thanks Charlie. Im an old school CFer and dont get to do so much coding these days so I was a little unsure of my repsonse. Im soon to resign though from my position in a different industry with aspirations of possibley getting back into the CF job market. Thanks again for the response. Dusty From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Arehart Sent: Monday, August 21, 2006 10:47 AM To: discussion@acfug.org Subject: RE: [ACFUG Discuss] Embedded CF in _javascript_ Nope, that's a good perspective to have, Dusty. I had in fact asked the same question in a reply to the list, but it's just not yet been received for some reason. /charlie http://www.carehart.org/blog/ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dusty Hale Sent: Monday, August 21, 2006 10:21 AM To: discussion@acfug.org Subject: RE: [ACFUG Discuss] Embedded CF in _javascript_ Not sure if this is a great answer and I am sure some of the more experienced ACFUGers may have a better answer. _javascript_ is usually done on the client side so I dont believe it is even possible to embedd CFML code into _javascript_. Someone please correct me here if I am wrong. The error below leads me to believe that you might just try renamming the query or possibly that the cfloop is trying to loop through a query named CATEGORY which may not exist. Possibly the name CATEGORY is reserved. Dont know if this help or hurts but may be worth a shot. Best of luck. Dusty From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of McTure, Greg Sent: Monday, August 21, 2006 9:56 AM To: discussion@acfug.org Subject: [ACFUG Discuss] Embedded CF in _javascript_ This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -
RE: [ACFUG Discuss] Embedded CF in Javascript
Did you try renaming the query named Category? Im not sure about this but it could just be a reserved word in CF5 but not in CFMX. Dusty From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of McTure, Greg Sent: Monday, August 21, 2006 10:46 AM To: discussion@acfug.org Subject: RE: [ACFUG Discuss] Embedded CF in _javascript_ Here are the parts of my code that the error is referring to. Be mindful that this functionality and code works nicely as intended on all three CFMX machines but not on the lone CF5 machine. The code is simply for dependent select drop-downs. The first drop down displays the major categories form the database and the 2nd and 3rd drop down equally displays the sub categories of the category selected in the first drop down. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd cfquery name=Category datasource=EPLCommunity SELECT ID, Category FROM Business_Cats WHERE SubCatOf = 0 ORDER BY Category /cfquery html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 SCRIPT LANGUAGE=_javascript_ !-- Begin biz_cat = new Array( cfloop query=Category startrow=1 endrow=#Category.RecordCount# cfquery name=SubCategory datasource=EPLCommunity SELECT ID, Category FROM Business_Cats WHERE SubCatOf = #ID# ORDER BY Category /cfquery new Array( CFLOOP query=SubCategory startrow=1 endrow=#SubCategory.RecordCount# CFOUTPUT new Array(#SubCategory.Category#, #SubCategory.ID#)CFIF SubCategory.CurrentRow LT SubCategory.RecordCount,/CFIF /CFOUTPUT /CFLOOP )CFIF Category.CurrentRow LT Category.RecordCount,/CFIF /CFLOOP ); function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) { var i, j; var prompt; // empty existing items for (i = selectCtrl.options.length; i = 0; i--) { selectCtrl.options[i] = null; } prompt = (itemArray != null) ? goodPrompt : badPrompt; if (prompt == null) { j = 0; } else { selectCtrl.options[0] = new Option(prompt); j = 1; } if (itemArray != null) { // add new items for (i = 0; i itemArray.length; i++) { selectCtrl.options[j] = new Option(itemArray[i][0]); if (itemArray[i][1] != null) { selectCtrl.options[j].value = itemArray[i][1]; } j++; } // select first item (prompt) for sub list selectCtrl.options[0].selected = true; } } // End -- /script From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teddy Payne Sent: Monday, August 21, 2006 10:14 AM To: discussion@acfug.org Subject: Re: [ACFUG Discuss] Embedded CF in _javascript_ We would need to see the code that the error is referring to. Teddy On 8/21/06, McTure, Greg [EMAIL PROTECTED] wrote: This is a general question to see if anyone has ran into issues with embedded CFML code in _javascript_ with a page working in CFMX and not in CF5? The code I have works as intended in CFMX but I get the following error on CF5? Any suggestions that anyone may have on the cause and/or resolution of this will be greatly appreciated. Thanks in advance. Error Diagnostic Information Cannot set default query to CATEGORY A query by this name is not available at this time The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (257:1) to (257:76). - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - -- cf_payne / Blog: http://cfpayne.wordpress.com/ Atlanta CFUG: http://www.acfug.org - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink - - To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -