Back from CFinNC!

I made it back from CFinNC, late Sunday night, extremely jet lagged, but in one piece, and very happy I made the decision to go. First, I want to thank Dan Wilson, and the rest of the folks that helped put this conference together. Not being able to attend MAX this year, I was very happy there was another ColdFusion-related conference, so soon after MAX. The fact that it was over a weekend made it much easier to schedule. As you may have read on CFCDev, Dan and I exchanged several posts about information on the conference website, what was/wasn't up to date, etc. Eventually, Dan and I took the conversation off-list (and off-email, talking more in person at the conference), and what became very clear to me is how genuinely personal he takes his work in the CF community; putting together this conference was no exception, and I think the quality of the CFinNC conference is proof of that. Everything seemed to run very smoothly -- registration was quick and painless, parking was a snap, wifi was up and accessible throughout the venue, the staff were all very courteous and happy to help. Nothing about the conference seemed out of place, or an obvious indicator that this was a newer project -- I was quite happy with how well everything was organized.

Session highlights for me included:

Mike Brunt -- 10 Steps To A High Performing ColdFusion Application, Clustering ColdFusion Great talk on performance testing, and all kinds of related items. Mike came with a real world demo that required not one, not two, but THREE laptops to get everything running (so it looked like it does in the real world) -- talk about putting a serious amount of effort into your lecture! My only regret is meeting Mike just minutes before I had to leave for my flight home; I was unable to say much more than "nice presentation" before I had to go. He was wearing a Beatles / Sgt Pepper shirt; I suspect we would have gotten along quite well. :)

Jason Dean -- Intro to Securing CFML Applications I met Jason at cf.Objective(), and caught his other talk on security. This one is the precursor to said cf.Objective() talk. Both are worth checking out; not too much overlap, you'll learn something new at each one. And you can play the drinking game "take 2 sips every time Jason says 'validation'". :)

Brian Kotek -- Intro to the Swiz Framework Nice first look at Swiz, with some notes on how it compares/contrasts to Caringorm, what Swiz is/isn't, how it can help w/ event handling, auto-wiring and tons more. For anyone new to Swiz, this was a great introduction.

Andy Matthews -- jQuery & AIR: Desktop Development for the Front End Designer While in NC, I was staying with my friend Rob who is typically known as a .NET developer. Half way through this presentation, I was tempted to call Rob and have him come watch -- I'm continually impressed by AIR/JavaScript fun that can be had in projects. Andy did a great job with this; very well put together presentation. Definitely worth checking out.

Joe Rinehart -- CF Inspirational Session I was not sure what to expect from the "Inspirational ColdFusion" session. Joe gave a great talk about what he's been up to for the last year-ish, how he'd moved away from CF, and how he's coming back into the fold. His presentation was hilarious, and it was one of the more comical yet compelling presentations I've ever seen. Joe missed his calling as a sitcom writer. :)

Rick Root -- Using Java in ColdFusion Applications Rick gave a great introduction to using Java classes in CF. This is a topic that I often see on lists/blogs, but it's always done as the answer to some other question, so the context of said blog posts often makes it hard for people to see that "first look" at how you can dip directly into Java from ColdFusion, and utilize both to improve your applications. That's where Rick's presentation came into play; don't go if you're already doing big crazy things like writing your own Hibernate wrapper for CF7, but if you want to see just how the CF data types are tied to Java data types under the hood (and how to utilize the power of both), then Rick's talk is worth checking out.

Bob Silverberg -- CF9 ORM - Part 1 and 2 Admittedly, I've been kind of dismissing the Hibernate integration in CF9 up until now. Partially because none of my clients have upgraded yet (tho 1 is talking about doing so), and partially because between Transfer and/or some homegrown things, I haven't really had a need to learn much more about it. Bob's talk was so good that I have now officially started "drinking the Kool-Aid", and want to start using CF/Hibernate whenever possible. I may very well (ahem) "borrow" content from his preso and give a similar demo for Saccfug later in the year. I would like to have seen a code sample in action, but the code presented in the slides was clear and "real world enough", that maybe that's not necessary.

It was also good seeing the familiar faces that I met at cf.Objective() -- Ben Nadel, Jason Dean, and others I'm forgetting -- as well as catching up with my friend Rob who moved to NC several years ago. North Carolina is a really pretty area -- trees everywhere, decent weather (and this is coming from a spoiled California punk *g*), and EVERYone I met was extremely nice and polite all weekend. Even the grits I had for dinner were pretty good! :)

Nice job, CFinNC, I hope you do it again next year. -nolan

Fun with Ajax and Firefox.

...and by "fun" I mean "WTF?!"

This code works just fine on Firefox 2.0.0.3 (on Windows XP):


pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
         <script>
             var dswfp = new Spry.Data.XMLDataSet( "/oasis/ajax_events/getRecordXmlSpry.cfm?strTableName=wafer_fab_process&stupid=0.967819147116", "root/row" );
         </script>
    
         <div spry:region="dswfp" id="wfp">
         <div class="loading" spry:state="loading"><p>Loading ...</p></div>
         <div class="ready" spry:state="ready">
         <table border="1">
         <tr>
         <th scope="col" spry:sort="WAFER_FAB_PROCESS_NAME">WFP Name</th>
         </tr>
         <tr spry:repeat="dswfp">
         <td>{dswfp::wafer_fab_process_name}</td>
         </tr>
         </table>
         </div>
         </div>
        </td>
    </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<script>
var dswfp = new Spry.Data.XMLDataSet( "/oasis/ajax_events/getRecordXmlSpry.cfm?strTableName=wafer_fab_process&stupid=0.967819147116", "root/row" );
</script>

<div spry:region="dswfp" id="wfp">
<div class="loading" spry:state="loading"><p>Loading ...</p></div>
<div class="ready" spry:state="ready">
<table border="1">
<tr>
<th scope="col" spry:sort="WAFER_FAB_PROCESS_NAME">WFP Name</th>
</tr>
<tr spry:repeat="dswfp">
<td>{dswfp::wafer_fab_process_name}</td>
</tr>
</table>
</div>
</div>
</table>

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

// my function for creating an XmlHttpRequest object
pReq = createRequest();

pReq.open( "GET", strURL, true );
pReq.onreadystatechange = _updateDropDown;
pReq.send( null );

pReq.send();

// my function for creating an XmlHttpRequest object
pReq = createRequest();

pReq.open( "GET", strURL, false );
pReq.onreadystatechange = _updateDropDown;
pReq.send( );

<cfexecute name="c:\windows\system32\tree.com" arguments="/?" timeout="20" variable="bar" />

<cfexecute name="c:\windows\system32\tree.com" arguments="/?" variable="bar" />

<cfdump var="#bar#" />


pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

...updateChildControls() gets called just fine, and all is good.

Note, I deliberately called open() with the 3rd argument set to "false". It would take a while to explain, but this is actually creating the type of behavior in the UI that I'm hoping for, so this is intentionally a bit off from the norm (at least in most of my Ajax books).

However that same code does NOT run on Firefox 2.0.0.9 (on Windows XP), nor does it run on Firefox 2.0.0.6 on Ubuntu. No error messages on any of the machines. updateChildControls() simply never gets called!

I have to change it to this:


pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

pReq.open( "GET", strURL, true );

var pReq = createRequest();
pReq.open( "GET", strURL, false );
pReq.onreadystatechange = updateChildControls;
pReq.send( null );

<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
         <script>
             var dswfp = new Spry.Data.XMLDataSet( "/oasis/ajax_events/getRecordXmlSpry.cfm?strTableName=wafer_fab_process&stupid=0.967819147116", "root/row" );
         </script>
    
         <div spry:region="dswfp" id="wfp">
         <div class="loading" spry:state="loading"><p>Loading ...</p></div>
         <div class="ready" spry:state="ready">
         <table border="1">
         <tr>
         <th scope="col" spry:sort="WAFER_FAB_PROCESS_NAME">WFP Name</th>
         </tr>
         <tr spry:repeat="dswfp">
         <td>{dswfp::wafer_fab_process_name}</td>
         </tr>
         </table>
         </div>
         </div>
        </td>
    </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<script>
var dswfp = new Spry.Data.XMLDataSet( "/oasis/ajax_events/getRecordXmlSpry.cfm?strTableName=wafer_fab_process&stupid=0.967819147116", "root/row" );
</script>

<div spry:region="dswfp" id="wfp">
<div class="loading" spry:state="loading"><p>Loading ...</p></div>
<div class="ready" spry:state="ready">
<table border="1">
<tr>
<th scope="col" spry:sort="WAFER_FAB_PROCESS_NAME">WFP Name</th>
</tr>
<tr spry:repeat="dswfp">
<td>{dswfp::wafer_fab_process_name}</td>
</tr>
</table>
</div>
</div>
</table>

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

<cfqueryparam cfsqltype="cf_sql_date" value="#trim(form.startDate)#" />

<cfif StructKeyExists( arguments, "iAge" )>
<cfif Len( Trim( arguments.iAge ) )>
<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" />
<cfelse>
NULL
</cfif>
</cfif>

<cfqueryparam cfsqltype="cf_sql_integer" value="#trim(form.iAge)#" maxlength="3" null="#yesNoFormat(NOT len(trim(form.iAge)))#" />

// my function for creating an XmlHttpRequest object
pReq = createRequest();

pReq.open( "GET", strURL, true );
pReq.onreadystatechange = _updateDropDown;
pReq.send( null );

pReq.send();

// my function for creating an XmlHttpRequest object
pReq = createRequest();

pReq.open( "GET", strURL, false );
pReq.onreadystatechange = _updateDropDown;
pReq.send( );

<cfexecute name="c:\windows\system32\tree.com" arguments="/?" timeout="20" variable="bar" />

<cfexecute name="c:\windows\system32\tree.com" arguments="/?" variable="bar" />

<cfdump var="#bar#" />


pReq.open( "GET", strURL, true );

...which I find rather annoying.

Can anyone tell me WHY?! If we're not supposed to flip that 3rd argument to "false", then shouldn't it throw an exception? Give me a message in the Error Console? Something?

Maybe this is just what happens when trying to write code the day after Thanksgiving. Can I blame a chemical in the turkey? :)

Interesting JavaScript quirk w/ stopPropagation()

I'm developing my app, using Firefox, and in one of the files, I have the following javascript:

el = document.getElementById( "frmProcess" ); addEvent( el, "submit", validate );

Simple enough, right? I have a form called "frmProcess", and when that form's "submit" event fires off, I want the function validate() to fire off as well.

That part works fine, and as you may have guessed, validate(), well, validates some data in the given form. If the validation fails, it calls this line of code:

evt.stopPropagation();

...which doesn't work. The "submit" event doesn't stop running. The form happily submits itself as if nothing went wrong. After somedebugging I found 2 things:

1. Changing the offending line of code from "evt.stopPropagation();" to "evt.preventDefault();" fixes the issue.

2. evt.stopPropagation() worked just fine on other events (blur, click, etc). But if I attach the "submit" event, it bombs.

Now the million dollar question is: WHY!?!?!

Firefox didn't report an error, and nothing else seemed to be causing an issue. So WHY in the name of all that's good does a "submit" event have to be handled differently than other events? Is this a bug in Firefox? Some valid DOM thing that I just can't find documentation for?

--n

 
BlogCFC was created by Raymond Camden. This blog is running version 5.9.003. Contact Blog Owner