Ben Forta  
Ben Forta my bookscoldfusionabout me
ColdFusion 8 books now available! ben@forta.com
 

News

08-May-08
ColdFusion ISP List Update And Maintenance

  I've been doing some maintenance and code cleanup on my ColdFusion ISP List, and noticed that some entries have not been updated in years. If you know of any companies that are no longer in business, or who no longer offer ColdFusion hosting, or anything else I should be aware of, please let me know. Thanks.


Flex Renderers Can't Rely On creationComplete

  Yesterday I wasted an hour or so debugging a Flex itemRenderer that I was using to display an image instead of a value in a DataGrid column. The renderer had to simply pick one of six images based on the column value, and so it contained a single <mx:Image> tag and a function that set the Image source dynamically. And then I called that function on the renderer's creationComplete event.

Simple enough. Except that the wrong images were sometimes being displayed, the column had the right data, but the code used to select the image seemed to sometimes pick the wrong image. And what it picked seem to change each time I scrolled the DataGrid up and down!

I actually ran into a very similar issue with a TileList renderer a few weeks ago, but then I had no time to figure out the cause, and so I hacked a workaround. But this time, having been bitten by the same issue twice, I had to find out what was going on.

And what I discovered (by using traces and alerts) is that the creationComplete event does not get fired as I had expected. Rather, it seemed to fire only occasionally, and not once per DataGrid row, and so my image selection function was not being executed as expected.

Once I had figured out the problem I searched the docs for any info on renderers and creationComplete, and found this page. And sure enough, "Flex might reuse an instance of the item renderer or item editor, a reused instance of an item renderer or item editor does not redispatch the creationComplete event". Well, that explained it.

The right way to do what I wanted is to trap the dataChange event instead of creationComplete, as "Flex dispatches the dataChange event every time the data property changes".

And so I am posting this for my own future reference, just to make sure I don't run into it a third time.


07-May-08
Check Out ColdBricks, A ColdFusion Based Open Source CMS

  ColdBricks is a ColdFusion based CMS and site generator, and it's free and open-source. There's a very impressive live demo online, too. This one via fellow evangelist Serge Jespers.


Preserving ColdFusion Structure Member Case In Flex

  ColdFusion is case-insensitive, and Flex MXML and ActionScript are very case-sensitive. For consistency's sake, when ColdFusion variables are sent from ColdFusion to the Flash Player via Flash Remoting, names are converted to uppercase (that's the default behavior, and it can be changed if needed). So, a structure member named FirstName will be named FIRSTNAME when it arrives on the Flash Player (and referring to it as FirstName in MXML or ActionScript won't work).

But, you actually can force case to be maintained in structures, depending on how structure members are defined. Look at these two examples. The first won't preserve case:

In this example, if the structure were returned to the Flash Player, the members would be named FIRSTNAME and LASTNAME.

Here's another example, one that will indeed preserve case:

This example accomplishes the exact same result as the previous example, in that it creates a structure and defines two members. But in this example, structure member names will be preserved, and they would indeed be named FirstName and LastName when they arrive in the Flash Player.


06-May-08
TIOBE Responds

  Paul Jansen is TIOBE's Management Director, and he responded to my post yesterday about the ColdFusion being taken off the TIOBE Programming Index. Here is his message:

Hi Ben,

Thanks for your reply on our TIOBE index. I have added an extra question called "Who is Richard Bremner?" to the FAQ of the TIOBE index (see the end of the page). I hope that this answers your question.

Regards,

Paul

Paul, thank you for responding. I still believe that you made a mistake, both in removing ColdFusion from the index, and trusting the input of a single individual and not making the effort to check the facts for yourself. However, I do appreciate you responding to the reactions and feedback of the ColdFusion community.

[more]

Upcoming Appearances
 

TorontoFLEX - Toronto, Ontario, Canada
15-May-08
  Flex Camp is coming back to Toronto, and I plan on attending this one. Registration is free and now open.

WebManiacs 2008 - Washington, DC
19-May-08
-23-May-08
  Building on the success of last year's FlexManiacs, the new WebManiacs is 3 events in one - CFManiacs, FlexManiacs, and AIRManiacs. Over 50 speakers, more than 200 sessions, hands-on sessions, and much more.

Scotch on the Rocks 2008 - Edinburgh, Scotland
04-Jun-08
-06-Jun-08
  At the last minute I had to bail on this event last year, but I do plan on attending Scotch on the Rocks this year. No idea what my role will be or what I'll be speaking about, but ... I do plan on attending.

CFUnited 2008 - Washington, DC
18-Jun-08
-21-Jun-08
  The premier ColdFusion event. Once again, Adobe is the primary sponsor, and I intend to be there (along with lots of other CF team members).

MAX 2008 - San Francisco, CA
16-Nov-08
-19-Nov-08
  Our 10th MAX, this time in San Francisco.

MAX Europe 2008 - Milan, Italy
01-Dec-08
-04-Dec-08
  Our 2nd MAX Europe, this time in Milan.

my books  mailing list  cf resources

 
© Copyright 1997-2008 Ben Forta, All Rights Reserved