The sessionGateway is being called because cfparam evaluates the
default argument whether or not it needs to assign it to something.

Does your sessionGateway's getById() method automatically assign
session.userBean or does it only return a value? Is it perhaps writing
over a value passed by reference instead of value?

On Wed, May 21, 2008 at 4:23 AM, Scott Brady <[EMAIL PROTECTED]> wrote:
> I've run into a situation where a cfparam is resetting the variable,
> even though it already exists.  How could this happen?  Here's the
> offending block of code:
>
> <cfdump var="#session.userBean.getCampaignID()#">
> <cfparam name="session.userBean"
> default="#application.sessionGateway.getById(0)#" type="any" />
> <br>
> <cfdump var="#session.userBean.getCampaignID()#">
> <cfabort>
>
> When I run that (there's obviously more to the page than that :) ), I
> get "25" on one line [the proper value] and "15" on the other [the
> default value for the campaign ID]. But, I'm not sure why the
> sessionGateway method is even being called, since the userBean
> obviously exists.

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305787
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to