Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 7,433
Doug's Books

Read

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Stepcoupling: Creating and Sustaining a Strong Marriage in Today's Blended Family
  • 7 Steps to Bonding with Your Stepchild
  • Keys to Successful Stepfathering

In Queue...

<< September, 2008 >>
SMTWTFS
123456
78910111213
14151617181920
21222324252627
282930
Search Blog

Recent Comments
Re: Using Google as your CF Mail Server (by Kevin Pepperman at 8/30 6:36 PM)
Re: Just What Is 'Application Logic', Anyway? (by Calvin at 8/23 7:15 AM)
Re: Just What Is 'Application Logic', Anyway? (by Charlotte at 8/23 3:12 AM)
Re: What IS 'Business Logic', Anyway? (by Charlotte at 8/22 8:06 AM)
Re: Basic Security in Fusebox 5.5.x (sans XML) (by Jeff Knooren at 8/08 7:06 AM)
Re: American Airlines, YOU SUCK! (by aasux at 8/05 2:59 PM)
Re: How to Think about Controller objects and Model objects (by Rich at 7/31 2:15 PM)
Re: American Airlines, YOU SUCK! (by s at 7/30 10:32 PM)
Re: How to Think about Controller objects and Model objects (by Mark Mandel at 7/29 6:49 PM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by dougboude at 7/29 9:04 AM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

29 June 2008
My FB 5.5+ Content Pulled a David Blaine!
FB 5.5+ for Model-Gluers
For any of you Model-gluers out there who are dabbling in Fusebox 5.5+ (which I happen to be for a current client project), I came across a hair-pulling situation that I wanted to share with you in the hopes that you'll not have to endure the same.

The symptom: you wrote a perfectly good controller method that is being called and, according to the debugging, is rendering all of your content just fine. But, your final page returns completely empty! It's just gone, not there, not even a single line in your page's source. Poof! It pulled a David Blaine. After spending more time on this than I care to admit, following are the details of the issue and the solution.

The Cause and Solution
You know how in your MG controllers and model CFCs you're in the habit of typing out all of your attributes and their values when declaring a new CFFUNCTION (such as, "<cffunction name="getEntityDetails" output="false" access="public">")? And, you know how in MG, 99.9% of the time, your methods don't need to render any output and so you set the output attribute to "false" just out of habit? Well, if you're using FB 5.5+ (at least in the 'no xml' mode, which is what I'm doing), you have to be mindful NOT to set the output attribute to false if your method is going to render any page output (which is the way to do it in FB 5.5+ in the 'no-xml' mode). You may be saying "duh, if it's rendering output of COURSE you wouldn't set output="false"! But, typically if a method is going to render output, it's going to do so with either cfoutput tags or the like, which would trigger your programmer mind to remind you to change the output attribute. In the approach that FB 5.5+ takes to do this, however, the natural mechanism that would trigger your mind to make the output value change isn't tripped, because we're just not used to seeing it done that way (eg; <cfset myFusebox.do( action="layout.main_template" ) />). At least it didn't trip mine.

Here's an example of a non-working and a working FB 5.5+ method that performs my login functionality and then renders the appropriate display page:

Non-Functioning method:
<cffunction name="login" returntype="void" output="false">
   <cfargument name="myFusebox" />
   <cfargument name="event" />
   [code to perform login logic here]
   <cfset myFusebox.do( action="display.dspHome",contentvariable="body" ) />
   <cfset myFusebox.do( action="layout.main_template" ) />
</cffunction>


Functioning method:
<cffunction name="login">
   <cfargument name="myFusebox" />
   <cfargument name="event" />
   [code to perform login logic here]
   <cfset myFusebox.do( action="display.dspHome",contentvariable="body" ) />
   <cfset myFusebox.do( action="layout.main_template" ) />
</cffunction>


So, even though FB 5.5+ can be used in an MVC manner, and even though many of the ways of thinking you've grown accustomed to with Model Glue do translate directly over to FB 5.5+, SOME DO NOT. Just remain mindful of this fact as you take the FB 5.5+ journey and you should be able to avoid hitting dead ends such as this one.

Doug out.



Posted by dougboude at 11:28 AM | PRINT THIS POST! |Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes four place(s) before the letter K? (in the alphabet, if that wasn't already apparent)
Type your answer exactly two time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!