I'm building my first Fusebox app (yea!), but I've run into a situation and
want to know how others handle it. It's pretty common - a query gets run and
if the results aren't as expected, the user needs to be presented with a
message telling them to try again. I've done this scenario hundreds of time
in CF but I'm still trying to wrap my mind around the FB way.
For example, in my app a user selects a company's name from the default
fuseaction page and gets sent to a page to enter a store number in a form.
Then a SELECT query (qry_getstoreinfo.cfm) runs to see if the store they
entered belongs to the company. If it does, another query runs to retrieve
some info specific to that store. If the store they entered DOES NOT belong
to the company, I need to display a message to tell them to go back and try
again.
I've read thru the code from the fusebox.org site and the only place where I
can see where error messages get set and displayed to the user is in the
login app (in the Members circuit application). In that example, a
client.message gets set in act_login.cfm and then displayed on the login
form (dsp_loginform.cfm) when a user gets sent back to it because they
didn't enter a correct username or password.
So, if I follow this example, would it make sense to set a session.message
(I'm using session vars vice client vars) after my query if no records match
and then CFLocate them back to the page where they enter the store number
and then display the message using a CFIsdefined(session.message)? Or is
there a better way for handling these type of messages to the user? What
about if I had a fuseaction like "errormessage" and then a
dsp_errormessage.cfm file to show the message and then CFLocate the user
back to the page to re-enter their store number (I guess this page would be
akin to the GoTo attribute in the cf_returnfuseaction tag)? Would that make
more sense?
TIA,
Chris Montgomery [EMAIL PROTECTED]
Web Development & Consulting http://www.astutia.com
Allaire Consulting Partner
210-490-3249/888-745-7603 Fax 210-490-4692
AIM: astutiaweb; ICQ: 7381282; Firetalk: Ag78
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists