I'm going to try to describe this problem in abstract first.  I'm sure we'll
get into code examples before the end, but I did not want to dump nine
related CFCs on the list all at once.  Please bear with me, this is a bit
convoluted.

I have a fairly complex CFC/data structure.  My first attempt at OO/CFC
application design.  Lets start with the main CFC's
(Donor/Chairperson/Volunteer) each of which extend a CFC of basic
functionality (Profile).  Profile is a composite of 6 CFC's that group
different sets of functionality (Basic Data/General
Comments/Education/Family & Friend Relationships/Lifestyle/Special
Dates/Complaints).  All of these extend a small CFC containing common init
and display functions.

The main CFC is initiated and stored in the session scope: <cfparam
name="session.cps.profile"
default="#createObject('component','Profile_Donor').init(session.cps.id)#">
for example.  The main CFC then initiate each composite CFC which query the
database and stores the returned query in their "this" scope through a
getter function in each composite CFC.

The problem occurs when I try to update any of this data. In my update code,
I can not seem to refresh the data.  I have forms that collects the new
data, the form is submitted to a controller CFC, that calls the update
functions of the Main CFC (in the session scope) inherited from the Profile
CFC.  These functions in the Profile CFC, call the associated functions from
the appropriate composite CFC.  Then the update function in the composite
CFC updates the database and calls the getter function that queries the
database and stores the data in the "this" scope.  

For some reason this works, if I do it from a CFM file.  But, if I do it
from a controller type CFC, I seem to get some kind of separate
scope/instance somewhere?  That's the only theory I have anyway.  All the
update code works, but when I return, the data in the CFC/object in the
session scope has not been updated.

I doubt I explained that very clearly yet.  As I said this is rather
convoluted, and I'm not really sure where my problem is.  Any help in
understanding / explaining / resolving this issue would be most appreciated.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to