ColdFusion Muse

Memory usage on unevenly populated arrays

It sounds like a dull topic. Right up there with "planning for retirement for 20 year olds". However, it certainly is important to understand some of the nuances of arrays and structures because how you use them (and your choices on which one to use can greatly affect the future scalablility of your application.

I saw an excellent discussion recently on an email list. I owe this information on arrays to Pete Freitag and Joe Rinehart. The question posed was, is the "length" of the array strictly tied to the number of members in the array. The reason this is important is because arrays are widely used for reasons of speed. Since an array is a list of references (points) it usually ranks as the fastest way to "loop" through data. I say "usually" to cover my butt. I actually don't know of any faster way in any language - although I'm sure the excellent and knowledgable readers of this blog will happily point some out to me (ha). Anyway, consider this code...

Read More
  • Share:

Report Builder Limitations and CFR files

Mark Kruger May 16, 2005 2:44 PM Coldfusion MX 7, Using Coldfusion Tags Comments (0)

We are all aware that the report builder application is a template generation tool. It's quite useful with a number of nifty features. One of the cool things about it is that you can define a report template using dummy data that can be replaced at run time. This allows you to run and test the display attributes and charts of your report using something simple like CFQUERYNEW( ) which you then replace with the actual query by passing it into the CFREPORT tag.

What I was hoping for however, was a template that produced a file format that we could unpack and examine. Our goal would not be to become report writers for our clients (isn't that really a content editors job?). Our goal is to produce tools where they can mine and access the data themselves. I would love to be able to allow a web based user to generate their own reports from a wizard. Indeed we have a system very much like this for Ms SQL that makes use of the various stored procs for data type introspection and allows a user to build 1 or more queries to use in a report.

The biggest flaw in our system is the rather limited template system we have. I was hoping to be able to replace "front-end" template with an auto-generated CFR file. However, Macromedia in a disappointing move, has chosen to encrypt the CFR files. effectively making them useless except as a limited time-saver for developers faced with handling report content. I suppose a DBA or Access programmer could pretty easily get up to speed on the report builder. But as far as I can see there is no way to make use of this file format programmatically.

  • Share:

Adding an image to a CFGRID

Silly me, I assumeed you couldn't insert images into a flash CFGRID. I stumbed across this example on an excellent blog by As Fusion (laura Arguello and Nahuel Foronda). Apparently you can insert thumbnails right into the grid using an HTML element. That's a new one on me. The trick is to bind a column in the grid to a CfFormItem. As always, someone will always find a way.

<cfform name="myform" format="Flash" height="450" width="600" >
<cfgrid name= "grid" query="properties" height="200">
<cfgridcolumn name="city" header="City">
<cfgridcolumn name="photo" header="Photo">
</cfgrid>
<!--- show the picture in an html cfforitem
paragraph is added because Firefox sometimes fail to load the picture --->

<cfformitem type="html" height="200" width="300"
bind="{'<p><img src=\'images/'+grid.selectedItem.photo+ '\'></p>'}"
></cfformitem>
</cfform>

  • Share:

Getting a reference to a flash form in Javascript

It's trying not to have adequate access to the client side movie produced by a flash form. For example, I Have a large number of panels in an accordian pane and I want to hide or unhide them based on user preferences. I also want to resize the form movie as the panels are "hidden" to make better use of the visible area of the screen. I wanted to be able to change the "height" and "width" parameters of the movie.

The problem is, that while the "NOSCRIPT" block has an ID parameter to it, the "document.write" block that outputs the object tag does not have and ID parameter attached to it (in spite of my putting ID="blah" in the CFFORM tag). That seems like a bug. Anyway, I went about trying to find another way to access the properties of the embeded movie. I came up with the following:

Read More
  • Share:

Flash Form Debugging

While I'm enjoying the power and especially the "look and feel" of the new flash forms interface I'm are a little frustrated with the lack of good debugging information. It would be nice if additional information could be ported into the Coldfusion debugging info at the bottom - or a perhaps a log file could be written. It's very hard to know what's going on. When a flash form is long it takes a while to compile anyway. Because I don't know how long it should take I end up sitting on my hands waiting for the little "initializing" to appear. If it doesn't I assume something has gone wrong internally and start looking at the code. That's not exactly slam dunk debugging.

  • Share:

Flash Forms and the local shared object

Mark Kruger May 6, 2005 6:09 PM CFMX 7 Flash Forms, Coldfusion MX 7 Comments (2)

Coldfusion MX version 7 gives us a great new feature when using <CFFORM>. It renders the forms in a flash form. The look is clean and the result is well behaved and intuitive. We've had a lot of fun creating prototypes using flash form grids and the accordian pane or tabbed interface. It's great to be able to create a form with tabs that doesn't require round trips to the server and has solid validation routines. Along the way we hit a couple of challenges and came up with a few solutions ....

Read More
  • Share: