Ask a Jedi: Various Quickies...

Once again I’m going to try to cover a few Ask a Jedi questions at once. Here is the first one:

I'm trying to set a "double dynamic" variable. It is currently: <cfset myXMLDoc.feed.newsletterpubs.file[#LoopCount#].description.XmlText = "Hello"> However, the "newsletterpubs" portion is also dynamic (variable is "#ftp_select"). How can I incorporate 2 dynamic portions into this cfset statement?

You already had half the solution. Bracket notation can be used as many times as you want. So to replace the newsletterpubs with a var, just use another bracket:

<cfset myXMLDoc.feed[ftp_select].file[LoopCount].description.XmlText = "Hello">

You will also notice I got rid of the # sign in loopCount, it isn’t necessary. Next question:

Can you do a article explaining how to use the application.cfc? I can't figure out how the request method works for the life of me...it'd be great if you could help me out!

Funny you ask that - as I’m presenting on it at MAX next week. I’ll be doing an hour long session on it, and Simon Horwith is doing a 90 minute workshop on it, so you will have two places to learn about the new feature. Kind of a non-answer I realize, sorry. Let’s hit another one:

How do I embed a PDF in a HTML document?

I assume you may have missed it, but CFMX7 added support for PDF generation with the cfdocument tag. If you don’t have CFMX7, there are other options as well. ActivePDF has been around for quite some time. I’ve never used them, but they are an alternative. Another option is iText, a free Java-based PDF generator. I haven’t used it either so I can’t comment on how well it works.

Lastly, a BlogCFC question:

Kudos on your BlogCFC code. Maybe I missed something, but how are you adding pictures to your posts in BlogCFC?

I’m not doing anything special. I’m just adding IMG html tags. I am looking into ways to make it easier, but it will be after the 4.0 release.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments