Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Is it just me or are this.mappings acting funny?

$
0
0

I'm only speculating here, but there must be some kind of chicken-or-egg thing going on here.  Maybe the "this" scope can't be read until the Application.cfc object is actually instantiated (which wouldn't actually be until after the pseudo-constructor has completed).

 

I guess one could test this theory - define a custom "this" variable in Application.cfc (like this.myCustomVariable).  Then try to use it in another variable within the pseudo-constructor (like <cfset variables.myCustomVariable = this.myCustomVariable).  See if that works.

 

Then try the same thing in a custom object (like myCustomObject.cfc).  See if that works.

 

I may try this myself later as I don't have time right now.  But my suspicion is that both will behave the same - access to "this" scope variables cannot be done inside pseudo-constructor because the object is in the creation process and the "this" scope doesn't actually exist yet.

 

-Carl V.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>