ColdFusion Community

The online Coldfusion 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.

1 Comment

Steven Erat Comment by Steven Erat on 2 April 2008 at 8:12pm
Can you post a code example and the stack trace?

Add a Comment

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

Join this network

RSS

Latest Activity

Eric Gometz Eric Gometz is member #965 of ColdFusion Community. 44 minutes ago
Timothy Farrar Timothy Farrar replied to the discussion CF8 1 day ago
Tom King Tom King's profile changed 1 day ago
DevLano DevLano is member #964 of ColdFusion Community. 1 day ago
Featured
The group cferror.org by Adrian Lynch was featured9 Oct
Nick Tong Nick Tong joined the group cferror.org9 Oct
milanbaros milanbaros started a discussion called Essay Types9 Oct
milanbaros milanbaros is member #963 of ColdFusion Community. 9 Oct
Yves Yves's profile changed 9 Oct
Vijay Manickaraja Vijay Manickaraja's profile changed 9 Oct

Members

  • Eric Gometz
  • bill[y]
  • Chris Blackwell
  • Marc
  • Robert Grimmett
  • Sidney Maestre
  • Hugo Sombreireiro
  • Pablo Vos
  • Greg Stewart
  • Justice
  • Seth Johnson
  • Sam Pinizzotto

Translate this page

© 2008   Created by Nick Tong

Badges  |  Report an Issue  |  Privacy  |  Terms of Service