> We use the application.cfm to set certain variables like the > datasource. I am migrating some of our older code to use CF > components. For some reason, I am running into a issue where > the component cannot see the variable. > > I am calling it like this... > <cfinvoke component="functions" method="cancelOrder"> > <cfinvokeargument name="primarydatasource" > value="#primarydatasource#"> </cfinvoke> > > but the function doesn't know what #primarydatasource# is. Even > when I try and to include a cfargument in the function, it > still won't find it. > > <cfcomponent> > <cffunction name="cancelOrder"> > <cfargument name="primarydatasource" default = > "#primarydatasource#"> > > The only way I can get it to work is to use this line instead > of the one above. > <cfargument name="primarydatasource" default = > "#application.primarydatasource#"> > > What am I doing wrong?
Is the variable in the Application scope? If so, you need to specify that when you try to reference it. This has nothing to do with components. Inside a component, you will not be able to reference local variables from the page that called the component. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271714 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4