Re: Recursion anyone?

2005-10-27 Thread Stephen Whiteley
Thanks David, I get that:) Steve ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for

Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Hi I keep returning to this problem in order to build an infinite DHTML menu (a task which has now become a quest and a matter of honour). Does anyone know how to recurse through an adjacency list model table, of the following setup ID CategoryName ParentItemID Also, I hear you can use CFTREE

Re: Recursion anyone?

2005-10-26 Thread Thomas Chiverton
On Wednesday 26 October 2005 11:15, Stephen Whiteley wrote: know how to recurse through an adjacency list model table, of the following setup ID CategoryName ParentItemID topLevel=getNodesWithNoParent() foreach thisNode in topLevel{ print thisNode getChildren(thisNode) }

RE: Recursion anyone?

2005-10-26 Thread Kerry
) writeoutput(your javascript); buildmenu(variables.inst.menuqry.id[i]); } } } buildmenu(yourrootid); -Original Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 11:15 To: CF-Talk Subject: Recursion anyone? Hi I keep

Re: Recursion anyone?

2005-10-26 Thread James Holmes
Depending on your DB you may be able to do the recursion there rather than in the CF or JS code: http://www.oreilly.com/catalog/sqlpr/chapter/ch01.pdf On 10/26/05, Stephen Whiteley [EMAIL PROTECTED] wrote: Hi I keep returning to this problem in order to build an infinite DHTML menu (a task

RE: Recursion anyone?

2005-10-26 Thread Snake
Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 11:15 To: CF-Talk Subject: Recursion anyone? Hi I keep returning to this problem in order to build an infinite DHTML menu (a task which has now become a quest and a matter of honour). Does anyone know how

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Hi Yes the problem is the recursion can't get my head round it, never used CFSCRIPT before being a bit of a newbie. Not trying to build a DHTML menu from scratch and would use an off the shelf one. CFTREE in CFMX 7 will output xml or a structure depending on format= used. I'll keep playing

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
OK, this is my database setup ItemID,ParentItemID,AdCategoryName What I want to be able to do is output something like this (before I go to the DHTML menu stage, walk before I can run) Accommodation Self Catering Farmhouse Rustic Farmhouse Activities Walking Walking Routes Walking Shops etc.

RE: Recursion anyone?

2005-10-26 Thread Andy Matthews
--//- -Original Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 6:11 AM To: CF-Talk Subject: Re: Recursion anyone? Hi Yes the problem is the recursion can't get my head round it, never used CFSCRIPT before being a bit of a newbie. Not trying to build

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Kerry I'm trying to get you code to work but will be making a real hash of it, I wonder if you take a look at this, I think getting the query in is the problem. cfquery datasource=#DSN# name=getAllCategories SELECT itemid,parentitemid,adcategoryname FROM tblAdvertTypes /cfquery cfscript

RE: Recursion anyone?

2005-10-26 Thread Kerry
give you the first record's categoryname. when doing a for() loop, you _must_ use the counter variables.menuqry.adcategoryname[i] Good luck! -Original Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 14:51 To: CF-Talk Subject: Re: Recursion anyone? Kerry

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Thanks Kerry I'm starting to understand, got no experience of cfscript but it seems a lot like actionscript. Unfortunately I've tried to run the code and I'm getting the following error. Context validation error for tag cfscript. The start tag must have a matching end tag. An explicit end

RE: Recursion anyone?

2005-10-26 Thread Andy Matthews
- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 9:30 AM To: CF-Talk Subject: Re: Recursion anyone? Thanks Kerry I'm starting to understand, got no experience of cfscript but it seems a lot like actionscript. Unfortunately I've tried to run the code and I'm

RE: Recursion anyone?

2005-10-26 Thread Emmet McGovern
[mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 10:30 AM To: CF-Talk Subject: Re: Recursion anyone? Thanks Kerry I'm starting to understand, got no experience of cfscript but it seems a lot like actionscript. Unfortunately I've tried to run the code and I'm getting the following

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Thanks, missed that Still throwing an error though Variable PARENTITEMID is undefined. The error occurred in C:\Inetpub\wwwroot\bigtripper\recurse\testfunction.cfm: line 11 9 : function buildmenu(currentid,depth){ 10 : var i=0; 11 : for(i=1; i lte parentitemid.menuqry.recordcount;

RE: Recursion anyone?

2005-10-26 Thread Kerry
errors in your code is pushing it. -Original Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 15:52 To: CF-Talk Subject: Re: Recursion anyone? Thanks, missed that Still throwing an error though Variable PARENTITEMID is undefined. The error occurred in C

RE: Recursion anyone?

2005-10-26 Thread Kerry
buildmenu(10,0); /cfscript -Original Message- From: Stephen Whiteley [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 15:30 To: CF-Talk Subject: Re: Recursion anyone? Thanks Kerry I'm starting to understand, got no experience of cfscript but it seems a lot like actionscript

Re: Recursion anyone?

2005-10-26 Thread Thomas Chiverton
On Wednesday 26 October 2005 16:03, Kerry wrote: dude, I dont mind helping with the overall how do i do this, but asking me to debug simple errors in your code is pushing it. This is why most of the time I will only post pseudo-code, unless there is some important point the code needs to get

RE: Recursion anyone?

2005-10-26 Thread Kerry
Just had a read of the code, it does 2 queries for every parent in the database? Did I read that correctly? -Original Message- From: Emmet McGovern [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 15:49 To: CF-Talk Subject: RE: Recursion anyone? Here's a use of treeview.nets treeview

RE: Recursion anyone?

2005-10-26 Thread Kerry
make that 1 query for every parent, + 1 query for each child of each parent. -Original Message- From: Emmet McGovern [mailto:[EMAIL PROTECTED] Sent: 26 October 2005 15:49 To: CF-Talk Subject: RE: Recursion anyone? Here's a use of treeview.nets treeview with recursion. http

RE: Recursion anyone?

2005-10-26 Thread Emmet McGovern
at it for some time. Emmet -Original Message- From: Kerry [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 12:23 PM To: CF-Talk Subject: RE: Recursion anyone? make that 1 query for every parent, + 1 query for each child of each parent. -Original Message- From: Emmet

Re: Recursion anyone?

2005-10-26 Thread Stephen Whiteley
Hi Thanks everyone, there's lots of different approaches here which I'll look at over time. Brain got tired in the end! I just thought that with the new CFTREE format options i.e. xml and object, that there could be a quick (and easy) way to do DHTML menus. But I've learnt quite a bit, sorry

Re: Recursion anyone?

2005-10-26 Thread David Livingston
An easy way to do recursion in cf is to use a custom tag. One of the things you will have to do is have your top level be set to a parent id that wont get used in any levels below it. I like to set the top level to zero or one. The first time you call your custom tag you just pass the top