On Thursday, Jun 12, 2003, at 17:02 US/Pacific, Scott Barnes wrote:
In my prototype testing I have noticed that coldfusion doesn't keep track of the categories I add to the method, in that i instantiate the object at the start of the page, and then add different categories into different heirachies.. ie

The problem is that you use RandRange(10,99) to attempt to create unique keys - and you are getting key collisions. I modified your test page to print out the keys (catX.data.id) and after a few refreshes got this:



Navigation Adding [navA] to root Category Additon status true CAT13060310352522 Adding [navA-ChildA] to Branch navA cat B CAT13060310352530 Adding [navA-ChildB] to Branch navA cat C CAT13060310352530 Adding [navB] to root cat D CAT13060310352528 Adding [navB-ChildA] to Branch navB cat E CAT13060310352586

Folders
Adding [parentA] to root
Category Additon status true CAT13060310352568
Adding [parentA-ChildA] to Branch Fold-parentA
cat B CAT13060310352580
Adding [parentA-ChildB] to Branch Fold-parentA
cat C CAT13060310352512
Adding [parentB] to root
cat D CAT13060310352531
Adding [parentB-ChildA] to Branch parentB
cat E CAT13060310352534

See how catB and catC got the same key in the Navigation tree?

If you want unique keys, use UUIDs instead.

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to