• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Application Variables not available to CFC

New Here ,
Feb 24, 2011 Feb 24, 2011

Copy link to clipboard

Copied

I have an application that is working great. We use CFCs extensively. The CFC objects and application variables are set up in application.cfc (see below). The CFCs are in the cfc folder.  All the pages All is well.

<cfscript>

// CREATE APP VARIABLES

APPLICATION.AppInfo = structNew();

APPLICATION.AppInfo.mySchema = "dhop_123";

APPLICATION.AppInfo.mySchema = "dhop_123";

// CREATE OBJECT FOR CFC
ro = structNew();
ro.general = createObject('component', 'xxx.cfc.generalFunctions');

</cfscript>

The situation: I created a it of Ajax using jQuery. The page that I call is found and loads well via the script below. The parameters "Home" and "LetterToGet" are passed correctly to the page (getusers.cfm).

<script type="text/javascript">
$("document").ready( function () {

    $(".whichContent").click(function(e) {
        X = e.target.value;
        $("#Users").hide(100);
        $("#Users").load("ajax/getusers.cfm?Home=Users&LetterToGet="+X);
        $("#Users").show(500);
    $});

});
</script>

My page can actually access the CFCs in the CFC folders if they don't require any APPLICATION variables.  If they DO require APPLICATION variables, such as to run a query, they fail.

Is there a TYPICAL problem that occurs when a single page is called and tries to access the APPLICATION variables?

TOPICS
Advanced techniques

Views

481

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 25, 2011 Feb 25, 2011

Copy link to clipboard

Copied

LATEST

Application scoped variables should still be accessible from a CFC provided your

are still in the same application scope (you don't have another application.cfc/cfm taking precidence).


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation