> Hi,

> I have am modifying a badly written mx6.1 system.  I have
> a request.core
> Object that has methods that allow cfscript to use
> <cftags> ... ie
> request.core.include( 'file.cfm' ) (cfinclude),
> request.core.dump(
> variables ) (cfdump);

> I have a segment of code that contains these lines:

> request.core.dump( variables );
> request.core.include( '/Checkout/ordercomplete.cfm' );

> When I dump the variables scope I see all of the variables
> I need, but
> the /Checkout/ordercomplete.cfm page does not see them.

> Placing request.core.dump( variables ); as the first line
> of
> /Checkout/ordercomplete.cfm produces a dump of the
> request.core object.
> Somehow the variables scope has been replaced.  Anyone
> have any ideas
> why?  Here are the functions being called:

Hi Kevin,

It sounds like you're suffering from a ... well... scoping variables
with cfc's is a little different. I'm told that at one point in time
it was recommended that you could use cfinclude within a CFC method
and the include would share variables with the CFC, but that hasn't
been the case at least since the beta of the first version of MX.
Since then the variables scope in your CFC is separate from the
variables scope of your calling page and afaik there's not a
good/convenient way to bridge that gap. In an OO purist sense this is
a good thing, because it preserves encapsulation... I would imagine
the easiest workaround for you is going to be to use the request scope
instead of the variables scope for data used by your included files.
Another alternative would be to make your include function not a part
of your core CFC. If the function is instead simply injected into the
request scope as for instance request.include() then it won't have its
own variables scope to be confused with the variables scopes of the
calling template or the template being included.

hth

s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207160
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to