ColdFusion Muse

CFC Wrapper for 2D Barcodes Released

Mark Kruger December 17, 2007 10:13 AM Coldfusion Tips and Techniques, Coldfusion 8 Comments (0)

I have had a great many readers calling me and asking about the 2D barcode CFC mentioned in a recent post. You will be happy to know that it has been released. You can use this CFC to create 2D barcodes for printing and to read 2D barcodes containined in images. You can find the download link and read more about it on Ryan's blog. Keep in mind that the CFC is specific to CF8 and it uses a commercial (albeit inexpensive) Java library from Java4Less. Ryan and I would both be interested in any reviews or comments. If you end up using the tag we'd love to hear some follow-up on how it is being used.

  • Share:

Handling Faxes and 2D Barcodes in Coldfusion 8

Mark Kruger December 12, 2007 11:10 AM Coldfusion 8 Comments (9)

I have a secret that has nothing to do with underwear. People think I'm pretty smart but the truth is that I'm surrounded every day by talented developers who know how to solve problems and find innovative solutions. Just rubbing shoulders with people like that tends to increase my level of knowledge and ability. Among those people is Ryan Stille, a Coldfusion and Linux Guru who has added tremendously to the wealth of knowledge here at CF Webtools. In the last few days Ryan has managed to piece together a cost effective and innovative solution for a customer who wishes to handle incoming faxes in Coldfusion. Eventually he will post a CFC on his blog - but meanwhile I wanted to explain the problem and the elegant solution involved.

Read More
  • Share:

Iterations, Comparisons and JavaCast (Oh My)

Mark Kruger November 26, 2007 3:13 PM Coldfusion Optimization, Coldfusion 8 Comments (1)

Testing Gurus like Dave Watts and Robi Sen will tell you that iterative tests are only interesting in a passing academic sort of way. Indeed if you are testing a real world application don't bother setting up a fancy-pants loop with 50,000 iterations to see if you should use "IS" or "EQ". If you are going to test then take the time to test real world operations in your application. But while we are on the subject of iterative tests I got to pondering what goes on under the hood. For example, what happens when you do "var1 IS var2" in a CFIF.

Read More
  • Share:

Cast Your Java Arrays Upon the Water and They Shall Return in Due Season

Mark Kruger November 19, 2007 7:46 PM Coldfusion 8 Comments (5)

If you have ever had to use a Java Widget from inside of your Coldfusion page you might know about the Javacast() function. Javacast allows you to bind a variable to one of Java's primitive "types" like string, long, float etc. Why is Javacast() necessary? I'm glad you asked. In the old days of Coldfusion 4 and 5, CF treated any variable as a sort of mystery meat. It didn't look too closely at it until you chose to do something with it. Only when an operation required a variable to have the properties of a certain type did Coldfusion complain. This is still true to a large extent today.

If you have a URL variable called "total" that is supposed to contain a number, you can populate it however you wish. You can put the string "sasquatch" in it for example. Coldfusion will ignore the type and pass the variable along right up until you try to add shipping to it, or divide it by another number or something. Only then will Coldfusion throw an error. Of course, using CFCs allows you far more control over the "type" of variables in play - but you can still treat your variables in this "weakly typed" way if you wish.

Java, on the other hand, is a strongly typed language. Variables are defined as "new" this and "new" that - where the this and that are classes or objects with methods and properties. So things written in Java don't take just anything for arguments to worry about at runtime. Javacast() was invented to convert Coldfusion variables into specific java types that Java methods are expecting. Take the following as example:

Read More
  • Share:

Cfwindow Positioning Trial and Error

Mark Kruger November 6, 2007 11:17 AM Coldfusion MX 7, Coldfusion 8 Comments (1)

I love the new widgety stuff in Coldfusion 8. The Cfwindow tag caught my attention right away. it seemed like a quick and easy way to frame content on a page and make it manageable. For example, I had a list of items that appear on the home page of our tracking system. It's the "hotlist" - a list of open and active work orders and projects. I decided to use Cfwindow to make it draggable and re-sizable. It was easy.

<cfwindow
        height="475"
        resizable="True"
        initshow="True"
        x="380"
        y="150"
        closable="False"
        draggable="True"
        title="Hot List"
        name="hotlist"
        headerstyle="background-color: ##A7B3C2;">

Some looping code that outputs a list of links.
</cfwindow>
This worked splendidly. I ended up with exactly what I wanted - a nice scrolling window that was easy to drag and resize to accommodate more entries.

Since I loved the little drop shadow thingy I decided I would use it on the right hand side menu as well - just to frame in the menu with a header. Oops... this turned out to be quite difficult. Why? Because there is no way to anchor the window to the layout. The layout is dynamic on the right. The right hand menu "clings" to the right side of the screen - meaning the X and Y coordinates are different for each screen size. But the Cfwindow appears over whatever is on the screen and the "x" and "y" coordinates make it's position absolute. I went hunting for an answer.

Read More
  • Share: