AW: cfmail and Groupwise-SMTP
No, the cf8-server doesnt log the correct answer of the mailserver. And, there is no script error when I send to a malformed address :-( Viele Grüße Thomas Stichnoth -Ursprüngliche Nachricht- Von: Russ Michaels [mailto:r...@michaels.me.uk] Gesendet: Montag, 6. September 2010 23:50 An: cf-talk Betreff: Re: cfmail and Groupwise-SMTP in the mail settings you need to set *Error Log Severity to warning or error I believe Russ * On Mon, Sep 6, 2010 at 9:43 PM, Thomas Stichnoth i...@stichnoth.net wrote: Hello, curious: Im using a Groupwise-SMTP-Server with CF8. Delivery of Mails is working. But, when I try to send mail with an illegal recipient, I get no error in the Coldfusion-Logs (debug=yes), Status 250 OK. If I try the same via Telnet, I get the an error (550) Any Idea? Kind regards Thomas Viele Grüße Thomas Stichnoth Thomas Stichnoth Internetkonzepte und -lösungen stichnoth.net Rühmkorffstr. 18 30163 Hannover http://www.stichnoth.net Tel. 0511 / 7601528 Fax 0511 / 7601530 Priv. 0511 / 2137769 Mobil 0175 / 1768800 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336846 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CFDUMP not allowed in CFTHREAD in 9 - allowed in 8
This was new, just migrated some applications from an 8 to a 9 server. Part of our code started to fail. We have a process that uses CFDUMP and mails us the result as we run a process. The process sits inside of a CFTHREAD. This works in 8, it fails in 9. Remove the CFTHREAD, the code works - or remove the CFDUMP and the code works. But have CFTHREAD with CFDUMP inside will fail. Is this a reported bug? I couldn't find anything, and it was strange to see this happen moving from 8 to 9. Could this be related to the reduction in allowable CFTHREADS run concurrently from 8 to 9 - does the CFDUMP inside a CFTHREAD somehow count as additional threads being run - and because it's in the CFTHREAD it just fails because it can not que a thread in a thread (grasping fro staws here, but trying to figure this out). Stephen ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336847 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Can I tell CF to dump me all run query names?
Is there a way to ask ColdFusion to dump the names of all the CFQuery resultsets? For example, I have some code that runs several cfqueries - the specific ones change based on circumstance - at the request of a page. What I would like to do is dump some sort of variable created by CF that lists me all the names of the CFquery resultsets. It's late - I've likely not enunciated my problem well. Stephen. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336848 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Can I tell CF to dump me all run query names?
Depends how you've scoped them. Here's a quick example if they're unscoped: cfloop item=CurVar collection=#Variables# cfif isQuery(Variables[CurVar]) cfdump var=#Variables[CurVar]# label=#CurVar# / /cfif /cfloop If you've got multiple scopes used, and/or function local ones, then use a debugging template instead. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336849 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFDUMP not allowed in CFTHREAD in 9 - allowed in 8
I'm not seeing any issue with it: cfthread name=doit cfset sleep(2000) cfdump var=#url# /cfthread cfset threadJoin(doit) cfdump var=#cfthread# This works fine for me, On Tue, Sep 7, 2010 at 4:27 AM, Stephen Cassady stephen.cass...@lopedia.com wrote: This was new, just migrated some applications from an 8 to a 9 server. Part of our code started to fail. We have a process that uses CFDUMP and mails us the result as we run a process. The process sits inside of a CFTHREAD. This works in 8, it fails in 9. Remove the CFTHREAD, the code works - or remove the CFDUMP and the code works. But have CFTHREAD with CFDUMP inside will fail. Is this a reported bug? I couldn't find anything, and it was strange to see this happen moving from 8 to 9. Could this be related to the reduction in allowable CFTHREADS run concurrently from 8 to 9 - does the CFDUMP inside a CFTHREAD somehow count as additional threads being run - and because it's in the CFTHREAD it just fails because it can not que a thread in a thread (grasping fro staws here, but trying to figure this out). Stephen ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336850 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFDUMP not allowed in CFTHREAD in 9 - allowed in 8
Can this be becuase of change in cfdump output structure from CF8 to CF9? And the application depending on the same? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336851 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
As far as I know, CF will not encode HTML unless you tell it to. Are you 100% sure you aren't using htmlEditFormat on the data? I have traced the XML value from start to end, and it appears that the place where the HTML is being converted is when I write the XML to disk. I am dumping the XML to the page all throughout the process, and it looks correct all the way until I write it to the file. Before the file write the XML has the plain HTML, but once written to the file the HTML is converted to entity characters. Here's what I'm doing: cffile action=write file=D:\parksMapFiles\parks.xml output=#toString(parksXML)# ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336852 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
As far as I know, CF will not encode HTML unless you tell it to. Are you 100% sure you aren't using htmlEditFormat on the data? I have traced the XML value from start to end, and it appears that the place where the HTML is being converted is when I write the XML to disk. I am dumping the XML to the page all throughout the process, and it looks correct all the way until I write it to the file. Before the file write the XML has the plain HTML, but once written to the file the HTML is converted to entity characters. Here's what I'm doing: cffile action=write file=D:\parksMapFiles\parks.xml output=#toString(parksXML)# ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336853 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
As far as I know, CF will not encode HTML unless you tell it to. Are you 100% sure you aren't using htmlEditFormat on the data? I have traced the XML value from start to end, and it appears that the place where the HTML is being converted is when I write the XML to disk. I am dumping the XML to the page all throughout the process, and it looks correct all the way until I write it to the file. Before the file write the XML has the plain HTML, but once written to the file the HTML is converted to entity characters. To write the XML to file I am using cffile and then for the output I use toString() on the xml object. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336854 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
SQL ColdFusion Encryption
Hi, I know how to encrypt data using ColdFusion using AES_128. I also know how to encrypt data using MSSQL AES_128. Does anyone know if it's possible to encrypt data in ColdFusion using AES_128, then decrypt the string in MSSQL? I've played around with it a lot and can't seem to figure it out. Thanks, Paul ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336855 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Question on form variables
Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336856 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Question on form variables
Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. You'd need to add a hidden form field on page one, and populate it's value from the FORM variable you're creating. -Original Message- From: fun and learning [mailto:funandlrnn...@gmail.com] Sent: Tuesday, September 07, 2010 1:29 PM To: cf-talk Subject: Question on form variables Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336857 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. You'd need to add a hidden form field on page one, and populate it's value from the FORM variable you're creating. Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336858 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Question on form variables
So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy -Original Message- From: fun and learning [mailto:funandlrnn...@gmail.com] Sent: Tuesday, September 07, 2010 1:50 PM To: cf-talk Subject: Re: Question on form variables Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. You'd need to add a hidden form field on page one, and populate it's value from the FORM variable you're creating. Hi All - This might be a silly question, but I am confused with below scenario...I have some form variables set on a page, and clicking on submit button, I go to second page, where I am dumping these form variables...Some of the variable values show up as empty string, but when I see the form variables in the coldfusion debugging section, all the variable values are set. Am I missing something here? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336859 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
When verifying the dumped text throughout the process, you're looking at the view source version, and not the one that's rendered by the browser, right? :Den -- The soul which has no fixed purpose in life is lost; to be everywhere, is to be nowhere. Michel de Montaigne On Tue, Sep 7, 2010 at 10:55 AM, Jake Munson wrote: As far as I know, CF will not encode HTML unless you tell it to. Are you 100% sure you aren't using htmlEditFormat on the data? I have traced the XML value from start to end, and it appears that the place where the HTML is being converted is when I write the XML to disk. I am dumping the XML to the page all throughout the process, and it looks correct all the way until I write it to the file. Before the file write the XML has the plain HTML, but once written to the file the HTML is converted to entity characters. To write the XML to file I am using cffile and then for the output I use toString() on the xml object. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336860 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
Yes, you are right. So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336861 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Question on form variables
Are you cfparaming those variables at the top of page two? Are you cfincluding any code that might overwrite those variables? andy -Original Message- From: fun and learning [mailto:funandlrnn...@gmail.com] Sent: Tuesday, September 07, 2010 2:01 PM To: cf-talk Subject: Re: Question on form variables Yes, you are right. So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336862 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
My guess is that you've not set the method attribute in your form to post, the default is get if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning funandlrnn...@gmail.com wrote: Yes, you are right. So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336863 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
Any chance you could just share your code with us so we can stop guessing about it? =] On Tue, Sep 7, 2010 at 12:28 PM, Matthew a.matthe...@yahoo.com wrote: My guess is that you've not set the method attribute in your form to post, the default is get if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning funandlrnn...@gmail.com wrote: Yes, you are right. So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336864 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
Thank you All..There was some other place where this variable was getting overwritten... Are you cfparaming those variables at the top of page two? Are you cfincluding any code that might overwrite those variables? andy Yes, you are right. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336865 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Question on form variables
If that were the case then why would the var names show up in the cfdump for the FORM scope? -Original Message- From: Matthew [mailto:a.matthe...@yahoo.com] Sent: Tuesday, September 07, 2010 2:28 PM To: cf-talk Subject: Re: Question on form variables My guess is that you've not set the method attribute in your form to post, the default is get if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning funandlrnn...@gmail.com wrote: Yes, you are right. So you're saying that when you inspect the FORM scope, by cfdumping it, on page two that the variables are there? But when you output them by themselves (FORM.varOne) they're empty? andy Yes, I am setting the hidden variables Setting a variable into the FORM scope on page one, will not automatically put those variables, or their values, into the FORM scope on page two. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336866 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Question on form variables
it was happening as below: cfif isDefined(URL.var1) cfset Form.var1 = URL.var1 cfelse cfset Form.var1 = /cfif If that were the case then why would the var names show up in the cfdump for the FORM scope? My guess is that you've not set the method attribute in your form to post, the default is get if not set. Sent from my iPhone On 7 Sep 2010, at 20:00, fun and learning funandlrnn...@gmail.com wrote: ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336867 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Finding if a key exists in a struct based on a variable name
If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336868 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
When verifying the dumped text throughout the process, you're looking at the view source version, and not the one that's rendered by the browser, right? Sorry for the multiple replies earlier...I have no idea why that happened. Yes, that's correct I'm using view source. In fact, I even wrote the value to a file BEFORE inserting to the XML Object, and it looks fine in the file as well. It's only when I insert to the XML object that the HTML is converted. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336869 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
This should work fine: cfif structKeyExists(somestruct, #y#head) You don't need IIF at all. On Tue, Sep 7, 2010 at 3:04 PM, Michael Grant mgr...@modus.bz wrote: If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336870 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
When you cfdump something, it escapes it. So if you view source it, you are seeing cfdump's escape. In other words, it isn't the REAL value. On Tue, Sep 7, 2010 at 3:08 PM, Jake Munson jmun...@idahopower.com wrote: When verifying the dumped text throughout the process, you're looking at the view source version, and not the one that's rendered by the browser, right? Sorry for the multiple replies earlier...I have no idea why that happened. Yes, that's correct I'm using view source. In fact, I even wrote the value to a file BEFORE inserting to the XML Object, and it looks fine in the file as well. It's only when I insert to the XML object that the HTML is converted. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336871 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
I know, but I want it inline of an html tag, so that's why I wanted IIF instead of an if/else block. On Tue, Sep 7, 2010 at 4:15 PM, Raymond Camden rcam...@gmail.com wrote: This should work fine: cfif structKeyExists(somestruct, #y#head) You don't need IIF at all. On Tue, Sep 7, 2010 at 3:04 PM, Michael Grant mgr...@modus.bz wrote: If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336872 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
It works for me: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p cfset x[allhead] = 1 cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput I correctly get no/yes. On Tue, Sep 7, 2010 at 3:37 PM, Michael Grant mgr...@modus.bz wrote: I know, but I want it inline of an html tag, so that's why I wanted IIF instead of an if/else block. On Tue, Sep 7, 2010 at 4:15 PM, Raymond Camden rcam...@gmail.com wrote: This should work fine: cfif structKeyExists(somestruct, #y#head) You don't need IIF at all. On Tue, Sep 7, 2010 at 3:04 PM, Michael Grant mgr...@modus.bz wrote: If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336873 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Here's what I have: #iif(StructKeyExists(x.classAssign,#y#head),DE(x.classAssign[#y#head]),DE(''))# The error I get is: Element NAMEhead is undefined in a CFML structure referenced as part of an expression. Since I couldn't get it working I switched it to an if/else statement and got the effect I desired, but I don't get why the above code wouldn't work. Even though I've moved on I'd still love to know why it's not working. Thanks. On Tue, Sep 7, 2010 at 4:48 PM, Raymond Camden rcam...@gmail.com wrote: It works for me: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p cfset x[allhead] = 1 cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput I correctly get no/yes. On Tue, Sep 7, 2010 at 3:37 PM, Michael Grant mgr...@modus.bz wrote: I know, but I want it inline of an html tag, so that's why I wanted IIF instead of an if/else block. On Tue, Sep 7, 2010 at 4:15 PM, Raymond Camden rcam...@gmail.com wrote: This should work fine: cfif structKeyExists(somestruct, #y#head) You don't need IIF at all. On Tue, Sep 7, 2010 at 3:04 PM, Michael Grant mgr...@modus.bz wrote: If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336874 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Looks pretty similar, but mine works: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p cfset x[allhead] = booger cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput On Tue, Sep 7, 2010 at 3:55 PM, Michael Grant mgr...@modus.bz wrote: Here's what I have: #iif(StructKeyExists(x.classAssign,#y#head),DE(x.classAssign[#y#head]),DE(''))# The error I get is: Element NAMEhead is undefined in a CFML structure referenced as part of an expression. Since I couldn't get it working I switched it to an if/else statement and got the effect I desired, but I don't get why the above code wouldn't work. Even though I've moved on I'd still love to know why it's not working. Thanks. On Tue, Sep 7, 2010 at 4:48 PM, Raymond Camden rcam...@gmail.com wrote: It works for me: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p cfset x[allhead] = 1 cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput I correctly get no/yes. On Tue, Sep 7, 2010 at 3:37 PM, Michael Grant mgr...@modus.bz wrote: I know, but I want it inline of an html tag, so that's why I wanted IIF instead of an if/else block. On Tue, Sep 7, 2010 at 4:15 PM, Raymond Camden rcam...@gmail.com wrote: This should work fine: cfif structKeyExists(somestruct, #y#head) You don't need IIF at all. On Tue, Sep 7, 2010 at 3:04 PM, Michael Grant mgr...@modus.bz wrote: If my var y = myCell and I want to know if the key myCellHead exists in a struct how do I do it? I thought that the following would work in an IIF statement but it doesn't. iif(StructKeyExists(x.classAssign,#y#head),DE('yes'),DE('no')) Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336875 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
When you cfdump something, it escapes it. So if you view source it, you are seeing cfdump's escape. In other words, it isn't the REAL value. I suppose you probably saw my other response (I think we passed each other at the intersection), but if not... If I display the pre-xml value using CFOutput, the HTML looks fine. If I write the pre-xml value to a file, the HTML looks fine. If I insert the value to my XML object, the HTML gets escaped. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336876 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Try running this: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p !--- cfset x[allhead] = booger --- cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336877 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
So wait - you put the string into an XML object? Maybe you can pastebin more of the code. On Tue, Sep 7, 2010 at 3:52 PM, Jake Munson jmun...@idahopower.com wrote: When you cfdump something, it escapes it. So if you view source it, you are seeing cfdump's escape. In other words, it isn't the REAL value. I suppose you probably saw my other response (I think we passed each other at the intersection), but if not... If I display the pre-xml value using CFOutput, the HTML looks fine. If I write the pre-xml value to a file, the HTML looks fine. If I insert the value to my XML object, the HTML gets escaped. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336878 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Bah - I hacked away at it for 10 minutes before remembering why I hated IIF/DE in the first place. ;) On Tue, Sep 7, 2010 at 4:04 PM, Michael Grant mgr...@modus.bz wrote: Try running this: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p !--- cfset x[allhead] = booger --- cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336879 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. I guess not? On Tue, Sep 7, 2010 at 5:14 PM, Raymond Camden rcam...@gmail.com wrote: Bah - I hacked away at it for 10 minutes before remembering why I hated IIF/DE in the first place. ;) On Tue, Sep 7, 2010 at 4:04 PM, Michael Grant mgr...@modus.bz wrote: Try running this: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p !--- cfset x[allhead] = booger --- cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336880 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Finding if a key exists in a struct based on a variable name
CF9 has the ternary operator which is awesome. Works like JavaScript: cfset output = (boolean ? It was True : It was False) andy -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, September 07, 2010 4:17 PM To: cf-talk Subject: Re: Finding if a key exists in a struct based on a variable name HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. I guess not? On Tue, Sep 7, 2010 at 5:14 PM, Raymond Camden rcam...@gmail.com wrote: Bah - I hacked away at it for 10 minutes before remembering why I hated IIF/DE in the first place. ;) On Tue, Sep 7, 2010 at 4:04 PM, Michael Grant mgr...@modus.bz wrote: Try running this: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p !--- cfset x[allhead] = booger --- cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336881 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
So wait - you put the string into an XML object? Maybe you can pastebin more of the code. I have developed a workaround that avoids this problem, but for educational purposes here's the bit of code that seems to be hosing the HTML: cfset parksXML.Parks.Park[i].SiteAbstract.XmlText = editCopy editCopy is made up of various data, but this piece we are concerned with: font color=#045172 size=12bTrenner Park/b/fontbrbr Before the above XML insert this HTML is not escaped (as explained in a previous message). After the insert it looks like this: lt;font color=#045172 size=12gt;lt;bgt;Trenner Parklt;/bgt;lt;/fontgt;lt;brgt;lt;brgt; ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336882 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
Before the above XML insert this HTML is not escaped (as explained in a previous message). After the insert it looks like this: lt;font color=#045172 size=12gt;lt;bgt;Trenner Parklt;/bgt;lt;/fontgt;lt;brgt;lt;brgt; I should reiterate that I am not dumping the XML object and seeing this escaped HTML...I am writing the XML to a file and then I see the escaped HTML. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336883 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Unfortunately I'm on CF8. And I wonder if the ternary operator would be able to handle a dynamic value as the output as with my example. IIF works perfect for exactly the type of example you gave; a simple boolean evaluated to output a simple string. The problem lies in CF apparently evaluating the two outputs before determining if the StruckKey exists. On Tue, Sep 7, 2010 at 5:21 PM, Andy Matthews li...@commadelimited.comwrote: CF9 has the ternary operator which is awesome. Works like JavaScript: cfset output = (boolean ? It was True : It was False) andy -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, September 07, 2010 4:17 PM To: cf-talk Subject: Re: Finding if a key exists in a struct based on a variable name HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. I guess not? On Tue, Sep 7, 2010 at 5:14 PM, Raymond Camden rcam...@gmail.com wrote: Bah - I hacked away at it for 10 minutes before remembering why I hated IIF/DE in the first place. ;) On Tue, Sep 7, 2010 at 4:04 PM, Michael Grant mgr...@modus.bz wrote: Try running this: cfset x = {} cfset y = all cfoutput #iif(StructKeyExists(x,#y#head),DE('yes'),DE('no'))# /cfoutput p !--- cfset x[allhead] = booger --- cfoutput #iif(StructKeyExists(x,#y#head),DE(x[#y#head]),DE('no'))# /cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336884 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
A lot of people get DE() wrong. IIF does not short-circuit (http://en.wikipedia.org/wiki/Short-circuit_evaluation), meaning that your DE() gets evaluated even if the condition is FALSE. So, this will break: #iif(false, notFalse, false)# since notFalse does not exist. Same here: #iif(true, true, fols)# since fols does not exist. And finally your code: #iif(false, DE(x.classAssign[#y#head]), DE(''))# breaks since x.classAssign[NAMEhead] does not exist. DE evaluates a STRING parameter and finds double-quotes. If you pass in a variable, it looks for the value of that variable. Since you are passing x.classAssign[#y#head], it looks for x.classAssign[NAMEhead] and breaks. This will work: evaluate(DE(x.classAssign['#y#head'])) - notice the single-quotes surrounding #y#head! This is because we don't want DE to escape this, so we don't want to wrap it around double-quotes! Here is the code (I used no value instead of , but it's still the same code that you use): cfset x.classAssign = { NameHead = this head, NoNameHead = that head } / cfoutput cfset y = Name / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset y = NoExist / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset Y = 'Any' / See how these two differ: br / #DE(x.classAssign['#y#head'])#br / #DE('x.classAssign[#y#head]')# /cfoutput Michael Grant wrote: HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336885 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
Wow. I had no idea you could wrap DE in Evaluate. Did you come figure this out through trial and error or have I just never read it? Thanks for the post rex. On Tue, Sep 7, 2010 at 8:34 PM, rex li...@pgrworld.com wrote: A lot of people get DE() wrong. IIF does not short-circuit (http://en.wikipedia.org/wiki/Short-circuit_evaluation), meaning that your DE() gets evaluated even if the condition is FALSE. So, this will break: #iif(false, notFalse, false)# since notFalse does not exist. Same here: #iif(true, true, fols)# since fols does not exist. And finally your code: #iif(false, DE(x.classAssign[#y#head]), DE(''))# breaks since x.classAssign[NAMEhead] does not exist. DE evaluates a STRING parameter and finds double-quotes. If you pass in a variable, it looks for the value of that variable. Since you are passing x.classAssign[#y#head], it looks for x.classAssign[NAMEhead] and breaks. This will work: evaluate(DE(x.classAssign['#y#head'])) - notice the single-quotes surrounding #y#head! This is because we don't want DE to escape this, so we don't want to wrap it around double-quotes! Here is the code (I used no value instead of , but it's still the same code that you use): cfset x.classAssign = { NameHead = this head, NoNameHead = that head } / cfoutput cfset y = Name / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset y = NoExist / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset Y = 'Any' / See how these two differ: br / #DE(x.classAssign['#y#head'])#br / #DE('x.classAssign[#y#head]')# /cfoutput Michael Grant wrote: HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336886 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
Normally when you put HTML into an XML node, it has to be within cdata. So maybe CF is fixing the HTML for you? On Tue, Sep 7, 2010 at 4:40 PM, Jake Munson jmun...@idahopower.com wrote: So wait - you put the string into an XML object? Maybe you can pastebin more of the code. I have developed a workaround that avoids this problem, but for educational purposes here's the bit of code that seems to be hosing the HTML: cfset parksXML.Parks.Park[i].SiteAbstract.XmlText = editCopy editCopy is made up of various data, but this piece we are concerned with: font color=#045172 size=12bTrenner Park/b/fontbrbr Before the above XML insert this HTML is not escaped (as explained in a previous message). After the insert it looks like this: lt;font color=#045172 size=12gt;lt;bgt;Trenner Parklt;/bgt;lt;/fontgt;lt;brgt;lt;brgt; ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336887 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
Weird. I can't reproduce this: cfset s = font color=redbfoo/b/font cfxml variable=x root child name=one / /root /cfxml cfset x.root.child[1].xmlText = s cfoutput #x.root.child[1].xmltext# p #s# /cfoutput The value is NOT escaped in the XML, nor in the original variable. On Tue, Sep 7, 2010 at 8:13 PM, Raymond Camden rcam...@gmail.com wrote: Normally when you put HTML into an XML node, it has to be within cdata. So maybe CF is fixing the HTML for you? On Tue, Sep 7, 2010 at 4:40 PM, Jake Munson jmun...@idahopower.com wrote: So wait - you put the string into an XML object? Maybe you can pastebin more of the code. I have developed a workaround that avoids this problem, but for educational purposes here's the bit of code that seems to be hosing the HTML: cfset parksXML.Parks.Park[i].SiteAbstract.XmlText = editCopy editCopy is made up of various data, but this piece we are concerned with: font color=#045172 size=12bTrenner Park/b/fontbrbr Before the above XML insert this HTML is not escaped (as explained in a previous message). After the insert it looks like this: lt;font color=#045172 size=12gt;lt;bgt;Trenner Parklt;/bgt;lt;/fontgt;lt;brgt;lt;brgt; ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336888 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Finding if a key exists in a struct based on a variable name
So I went back and read the docs for IIF. I haven't looked at them in years and I'm shocked that I've used it for SO many years without really knowing exactly how it worked. I would've first read about IIF pre version 5. I can't even find the docs for it. Version 5's description is a little vague. You learn something new every day I guess. That's awesome. Thanks again Rex. On Tue, Sep 7, 2010 at 8:49 PM, Michael Grant mgr...@modus.bz wrote: Wow. I had no idea you could wrap DE in Evaluate. Did you come figure this out through trial and error or have I just never read it? Thanks for the post rex. On Tue, Sep 7, 2010 at 8:34 PM, rex li...@pgrworld.com wrote: A lot of people get DE() wrong. IIF does not short-circuit (http://en.wikipedia.org/wiki/Short-circuit_evaluation), meaning that your DE() gets evaluated even if the condition is FALSE. So, this will break: #iif(false, notFalse, false)# since notFalse does not exist. Same here: #iif(true, true, fols)# since fols does not exist. And finally your code: #iif(false, DE(x.classAssign[#y#head]), DE(''))# breaks since x.classAssign[NAMEhead] does not exist. DE evaluates a STRING parameter and finds double-quotes. If you pass in a variable, it looks for the value of that variable. Since you are passing x.classAssign[#y#head], it looks for x.classAssign[NAMEhead] and breaks. This will work: evaluate(DE(x.classAssign['#y#head'])) - notice the single-quotes surrounding #y#head! This is because we don't want DE to escape this, so we don't want to wrap it around double-quotes! Here is the code (I used no value instead of , but it's still the same code that you use): cfset x.classAssign = { NameHead = this head, NoNameHead = that head } / cfoutput cfset y = Name / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset y = NoExist / #iif(StructKeyExists(x.classAssign,#y#head), evaluate(DE(x.classAssign['#y#head'])), DE(no value))#hr / cfset Y = 'Any' / See how these two differ: br / #DE(x.classAssign['#y#head'])#br / #DE('x.classAssign[#y#head]')# /cfoutput Michael Grant wrote: HA! So I'm not the only one! So I thought DE meant Delay Evaluation as in Don't evaluate what's in these little brackets this until you've satisfied the IIF condition. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336889 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
Normally when you put HTML into an XML node, it has to be within cdata. So maybe CF is fixing the HTML for you? Yeah, I was just simplifying things, I do have a cdata tag wrapping the HTML. Doesn't help. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336890 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Preserve HTML format when inserting into HTML
I did something similar in a test page, but using the XML functions instead of cfxml. I was not able to reproduce it either...there's something odd about the original XML that is causing this, I guess. But like I said earlier, I created a workaround so I'm not stressing about it. It's just odd. Weird. I can't reproduce this: cfset s = font color=redbfoo/b/font cfxml variable=x root child name=one / /root /cfxml cfset x.root.child[1].xmlText = s cfoutput #x.root.child[1].xmltext# p #s# /cfoutput The value is NOT escaped in the XML, nor in the original variable. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336891 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CF Flash
I have a very interesting and good question: If you are using cfpresentation to dynamically build a presentation, how do you access the flash object to get the time setting? I have a client that I am building this for, and it pretty much set up, except that I need to be able to capture where the timer or slider is at if they happen to log out or the session expires. Does this make any sense? I am sure you can make an api call or something, or even use actionscript to grab it. Any help would be greatly appreciated. You can reach me at: john.euba...@dev-solutions.biz ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336892 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm