ColdFusion Community

The online ColdFusion / CFML community website

I have been working with some of my CFCs and was setting a default property for it. I'm using the CFProperty tags and the "this" scope as I'm returning the results to a flex component. I have all of my defaults set up in my cfproperty and "this" scope and was trying to use my "init()" function to return the object. However, each time I tried to access the object, ColdFusion was throwing the error message "5". That's right, just the number 5, nothing else.

Once I had narrowed it down to the init, I saw that I was using #now()# to set a default date, and #session.userId# in the cfproperty tags. Once I removed those calculated defaults in the cfproperty tag, and just left them in the "this" scope, everything worked correctly again. Does anyone know why (even disregarding the "5" error message) using calculated defaults for cfproperty throws errors?

I guess the solution is to just use calculated defaults in the "this" scope, but I wasn't sure the reasoning behind that.

Add a Comment

You need to be a member of ColdFusion Community to add comments!

Join ColdFusion Community

Steven Erat Comment by Steven Erat on April 2, 2008 at 7:12pm
Can you post a code example and the stack trace?
Specialists in ColdFusion Development

> Place your advert here <


Latest Activity

Besides the reply with Jane, the code in the CFSCRIPT tags executes more rapildly than in the cf tags. So it is good to use cfscript if we are want more optimized code....
13 hours ago
2 members updated their profile photos
13 hours ago
Ryan Nehring Hope this place is active, cuz it's one hell of a cool idea :)
yesterday
Ryan Nehring updated their profile
yesterday
I'd suggest using both, in most cases. Validation at the client end (probably Javascript) gives immediate response to the user, and no network trafffic. So you use it as your first step. But the user may have disabled Javascript, or be using somet…
yesterday
Server. If you want to flood your server's registry with junk and slow it down as much as possible, this is a very fine way of doing it. There's an article on the subject here: http://kb2.adobe.com/cps/179/tn_17919.html dating right back to CF 4.5…
yesterday
My usual answer would be "don't - do that in the database". But assuming that isn't approrpriate - what's wrong with the '&'?
yesterday
Ryan Nehring, Stephen Weyrick, Samuel Bouchard and 3 more joined ColdFusion Community
yesterday
A Great ColdFusion Framework by Rob for ajax Application Development
on Thursday
Vijayakumar.R joined Joshua's group
Those of you excited about the new release of Fusebox 5.5!!!!
on Thursday
ColdFusion developers who use Mach-II.
on Thursday
For people that love using the IDE that is Eclipse with the awesome plugin of CFEclipse
on Thursday

Members

  • Jane Williams
  • Wendell Boom
  • Anu V Muraleedharan
  • PROVEER CONSULTING Ltd
  • Hugo Sombreireiro
  • Shirak Grigor
  • Roberta Freese
  • Nick Tong
  • Ryan Nehring
  • Ellis Wood
  • Stephen Weyrick
  • Giampiero Bonifazi

Translate this page

© 2010   Created by Nick Tong

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

Sign in to chat!