On 10/16/06, Dave Hoff <[EMAIL PROTECTED]> wrote:
> I'm sure this isn't best practice, but I'm working with the "menu" event 
> gateway example that ships with CF7 and I'm trying to generate the menu from 
> a database replacing the hard-coded menu that is there. The menu is stored in 
> a session variable and I need to dynamically assign the session name and its 
> value.
>
> -------------
> childVar = "session.M" & i & "_" & j;
> tempVar = "session.M" & i;
>
> #childVar# = #tempVar#.addChild(name="#childName#", key="#j#", 
> cfc="#childCFC#", method="#childMethod#");
> -------------
>
> It looks like #childVar# works, but when I assign it to #tempVar#.addChild CF 
> throws an error.

What error is thrown?  For readability (and maybe functionality), try:

childVar = session['M' & i & '_' & j];
tempVar = session['M' & i];

Or, just do it all at once:

session['M' & i & '_' & j] = session['M' & i].addChild ( ... );

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

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

Reply via email to