Okay, there it is.  I just overlooked the first time.  I am impressed, I
think this could also be implemented in the FB4 structure as well.  I will
get with you off this list with my code that I come up with.

Thanks,
 
Jason L. West, Sr.
WezBiz Technologies
[EMAIL PROTECTED]
http://wezbiz.com
 
________________________________________
From: Kay Smoljak [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 22, 2004 00:50
To: CF-Talk
Subject: Re: Best method holding form data.

OK, it works like this:

- the add/edit fuseaction is called, with the id of the record to be
edited. qry_widget.cfm checks for the existence of a structure or
recordset with the same name first, and if it's not found, it then
populates a recordset based on that id. If the id is not 0, the
database is queried for the record. If the id is 0, querysim is called
to create a blank recordset. Either way, this recordset is copied into
the attributes scope.

- the form fuse displays the populated form. All variables are in the
form #attributes.queryname.fieldname#. If the id is 0,

- the form is submitted to the validation fuse. If validation passes,
the processing fuses are called (and will perform an insert if the id
is 0 and an update if it's not). If validation fails, cfmodule is used
to call the form display fuseaction again, with the layout suppressed.
The entire attributes scope is passed into the cfmodule call with the
same name as the query in the first step. The qry_widget.cfm fuse
doesn't overwrite the passed in structure because it checks for it's
existence before running the cfquery/querysim.

- When the form display fuse is called, the variables are displayed
because they're in the right format - #attributes.queryname.fieldname#
- although in this case it's a structure not a recordset.

At step one, you could use the querynew functions instead of querysim,
but I think the custom tag is a nicer abstraction.

Make sense? I think the code is a lot easier to understand than the
explanation!

--
Kay Smoljak
http://kay.smoljak.com/

On Sun, 22 Aug 2004 00:27:50 -0400, Jason L. West, Sr. <[EMAIL PROTECTED]>
wrote:
> I have scanned through your code over the past couple of minutes but am
> unable to see where the querySim comes into play.  Can you enlighten me?
________________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to