more cfwindow fun (model-glue, too!)
august 6, 2008 at 1:19am
in model-glue, ColdFusion
working on a model-glue application, i found myself in a situation where a <cfwindow> would come in handy. it's on a page that displays a list of items that belong to a user. for each item, the user can add a "journal entry". this is simply a plain text field and a time/date stamp. each entry displayed on the page has a link for "journal" that pops up a cfwindow that shows all of that item's journal entries, along with a form (a simple textarea) allowing the user to add a new entry.
using <cfform> allows the form submission to stay within the <cfwindow>, which worked great. a standard post allowed the page to refresh after the form was submitted (and the record inserted into the database), so it seemed to be a pretty user-friendly way to allow multiple journal entries to be added to an item. when the user was done adding entries, simply close the cfwindow.
here's where things got funked up... the first form submission worked great. the form's action page called an event-handler that did the insert, and added a named result to the event to redirect back to the journal.viewJournal event, which (obviously) displayed the contents of the journal. the event needed the concept of a transactionID, so i used the append attribute of the result tag as follows:
- <result name="success" do="journal.viewJournal" redirect="true" append="transactionID" />
when i went to add a second entry, however, the cfwindow tried to reload into the main/parent window. no matter how many times i tried, the first submission would work (the form submitted to the cfwindow), but the second submission would break (the form submitted to the parent window). realizing i needed the big guns, i whipped out firebug.
it seemed the original submission (the one that worked consistently) had a few parameters that would appear to have been added by CF:
- _cf_clientid
- _cf_containerID
- _cf_nocache
- _cf_nodebug
- _cf_rc
so, i tried adding them to the append attribute of the result tag as follows:
- <result name="success" do="journal.viewJournal" redirect="true" append="transactionID,_cf_clientid,_cf_containerID,_cf_nocache, _cf_nodebug,_cf_rc" />
fixed things right up. i could do submission after submission after submission, and they all worked within the cfwindow. not being the type of person who believes in overkill, and out of a bit of curiosity, i did try whittling down the list. seems all i really needed was the _cf_containerID (makes sense, since it was the concept of the container that was being lost). so, the code ultimately turned out to be:
- <result name="success" do="journal.viewJournal" redirect="true" append="transactionID,_cf_containerID" />
and with that... i'll call it an evening.
a model-glue gotcha
january 2, 2008 at 1:48pm
in model-glue, frameworks
i can't imagine this isn't a fairly well known "issue" in the model-glue community, but what with being new to model-glue, this was a new issue for me. i figure it's worth mentioning, if only to save somebody else the several billion hours of debugging that i lost this afternoon.
let me point out first that this isn't a model-glue issue per se. it's a combination of using model-glue with coldfusion debugging and some javascript thrown in for good measure (some of you may already know where i'm going with this).
the art of being right (learning OO)
december 7, 2007 at 4:00am
in model-glue, ColdFusion, going OO, frameworks
hey all. i'm back, and i'd like to officially apologize for going all bermuda triangle on you in the middle of the "going OO" series. i'd like to take a few minutes and reflect on some of what happened, because some of it is actually relevant.
first... the non-relevant bits. we moved (again). i thought it would be a fairly easy thing to do this time around... because unlike the last 2 times it wasn't an across country move (from AZ to FL and then from FL to CA). this time it was from CA (southern) to CA (east bay)... but it still really really sucked. it was just a very draining experience (both physically and mentally) and I never ever want to do it again (but i will).
factor in starting the new job (which is going great so far, thankyouverymuch) and i just haven't even had time to keep up with reading blogs, let alone writing an entry.
but things have settled down (somewhat) so i'm going to try and get back into the swing of things.
So the $64,000 question is... where'm i at with all of this OO stuff? hell of a question. sorta wish you hadn't asked. >sigh< but you did, so...

