Original call would look something like this, where entryID is all you need to
start with:
cfset myReplyTreeQry = getChildren(url.entryID, request.datasource)
This would create a query result called myReplyTreeQry with the following
columns:
entryID
replyID (of each reply)
Thank you very much - this works beautifully!
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
Did you look at this:
http://nstree.riaforge.org/
On Thu, Jul 24, 2008 at 1:36 PM, Mark Leder [EMAIL PROTECTED] wrote:
Hi All,
Been working on a recursion output for several days now without success.
Using a single category table with ID, Name, ParentID. The nesting is up
to four layers
I did. Couldn't figure out that logic + tree breaks when I only want to
return nodes and levels that correspond with documents/db listings on the
server.
-Original Message-
From: Gerald Guido [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2008 2:09 PM
To: CF-Talk
Subject: Re
and levels that correspond with documents/db listings on the
server.
-Original Message-
From: Gerald Guido [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2008 2:09 PM
To: CF-Talk
Subject: Re: Recursion Output Help
Did you look at this:
http://nstree.riaforge.org/
On Thu, Jul 24
This little factorial function will show you that limit in a hurry
IMO, with a factorial function, you will hit a numeric overflow far
before any limit in recursion level.
I have some recursive functions, got them loop to infinity while
debugging, and like in most languages,
the only limit I
The recordset is not returning the heirarchy correctly however.
Please define not correctly
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
run it and find out. It is not a memory issue.
--
Wil Genovese
One man with courage makes a majority.
-Andrew Jackson
A fine is a tax for doing wrong. A tax is a fine for doing well.
Claude Schneegans wrote:
This little factorial function will show you that limit in a hurry
IMO, with
run it and find out. It is not a memory issue.
Of course it is not.
Recursing to a level of 1000 is not a problem.
As I said, with a factorial function, you will hit an overflow before
any limit of recursion or any memory limit.
Can ou imagine how large is 1000! ?
At a certain point, you hit
this is a wondeful tutorial matt! thanks heaps for the link.
a lot is a little over my head, but i am getting there!!
mike
http://tutorial478.easycfm.com/
~|
Check out the new features and enhancements in the
latest product
I'm not sure how many levels of recursion your trying to do, but with CF
there is a limit to recursion. This little factorial function will show
you that limit in a hurry if you put in a large enough value.
cffunction name=factorial access=public returntype=numeric
output=yes
cfargument
i will only ever be going 2-3 levels deep at this stage.
I'm not sure how many levels of recursion your trying to do, but with CF
there is a limit to recursion. This little factorial function will show
you that limit in a hurry if you put in a large enough value.
cffunction name=factorial
You can get the whole structure on one query:
http://www.oreilly.com/catalog/sqlpr/chapter/ch01.pdf
On 9/21/07, Mike Little [EMAIL PROTECTED] wrote:
i will only ever be going 2-3 levels deep at this stage.
I'm not sure how many levels of recursion your trying to do, but with CF
there is a
http://tutorial478.easycfm.com/
~|
Check out the new features and enhancements in the
latest product release - download the What's New PDF now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
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
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)
}
There are loads and loads of DHTML menus out there, e.g.
http://www.dynamicdrive.com/dynamicindex1/hvmenu/
with the actual menu code taken care of, all you have to do is recurse over
your database and write out the menu items.
last time i checked, cftree outputs a java applet, not javascript.
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
Why not use one of the nice DHTML menus that already exists.
I have built a tag that creates an DHTML explorer tree, and all I do is
query my category's, putitng them in the correct order, then recursively
loop over that query to check for child items of the current node.
--
Russ
-Original
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
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.
--//-
-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
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
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
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
-
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
[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
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;
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
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
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
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
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
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
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
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
Jake, I did something that might help you.Its a recursive function that
uses one db call.You can see it at work by creating an account and
creating a survey here.www.surveys.theanticool.com
http://www.surveys.theanticool.com .The interface to create the survey
uses only ie at this point(I know I
Hi Jake
There is an article about recursion from Steve Majewski on defusion.com. I think this article answers your questions.
http://www.defusion.com/articles/index.cfm?ArticleID=63
HTH
Dominik
-Original Message-
From: Jake McKee [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24,
Jake
No it does not! In the lower section of the article, just over the source code of the recursive Custom Tag, it is written: To get CFX_MakeTree to put the items in any other order, you would have to completely reorganize your database, and nobody wants to do that.An alternative to hours of
This is what I generally use.Let me know if you need clarification.
cffunction name=list_categories returntype=string output=No
cfargument name=myCatId type=numeric default=0 required=true
cfset var currQuery =
cfset var returnString =
cfquery name=currQuery datasource=#request.dsn.name#
Try using the var keyword in your first four cfset statements.
cfset var root_node = Arguments.node
cfset var levels = ...
-Original Message-
From: Cedric Villat [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 12:59 PM
To: CF-Talk
Subject: Recursion and Scope problem?
Ok,
Because you where using the default scope that can be seen by default all
functions can see. The Var keyword declares the scope private to the
function alone.
--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
-Original Message-
From: Cedric
As I understand it ( and I'll be quickly corrected if I'm wrong ), here's
how scope works.
In a CF page, all variables on that page (and cfinclude'd pages) have the
same Global scope...functions included. By using the var keyword,
you're telling CF to make the declared variable private scope of
basically, you call the function once and the vars are declared in the
global scope, when that function calls itself, it redeclares them again in
that same global scope, so they are overwritten. So, when the top function
continues, its variables are no longer the ones it set. Using the var
I've done what you have done here with both CFC's and before the Custom
Tags. It's fairly easy to right a recursive custom tag, since each call to
the tag gets it's own attributes scope.
This one is recursing over a Structure creating an indented tree select
list. It could easily be modified to
First and foremost, we can't run queries inside of cfscript tags.
Bummer.
easy enough with a wrapper function.
Second, even if the query issue were resolved (and if you've got ideas for
work-arounds, I'd love to hear them), you've now got variable scope
issues.
A variable declared in a CFMX
On Wednesday, Jul 9, 2003, at 13:13 US/Pacific, Hagan, Ryan Mr
(Contractor ACI) wrote:
function list_categories( $parentId, $level ) {
cffunction name=list_categories
cfargument name=parentId type=numeric
cfargument name=level type=numeric
global $database, $connection;
: 360.647.5351
www.audiencecentral.com
-Original Message-
From: Paul Hastings [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 1:33 PM
To: CF-Talk
Subject: Re: recursion in cold fusion ( was RE: Creating a list with
infinite groupings and indents )
First and foremost, we
Hagan, Ryan Mr (Contractor ACI) wrote:
I personally like this solution quite a bit. I know it has performance
issues, but I've never noticed any significant impact on server response,
even under heavy load.
I think it is an ugly workaround. SQL is a set oriented language and the
best way
Subject: Re: Recursion Tutorial?
Howdy Jake,
Tuesday, May 27, 2003, 11:16:23 PM, Jake McKee wrote:
... I am looking for good sources of help/tutorial on recursion. ...
Here's some links I've collected. Most of them relate to hierarchical
database design but you may find them useful anyway
Some more links on recursion I just found:
http://cfhub.com/advanced/customtags/recursion.cfm
http://www.cfhub.com/tutorials/ftp2tree/recursion.cfm
In addition, you might want to search the CF-Talk archives for the
following subject lines:
CF recursive question
Recursive parent/child
Howdy Jake,
Tuesday, May 27, 2003, 11:16:23 PM, Jake McKee wrote:
... I am looking for good sources of help/tutorial on recursion. ...
Here's some links I've collected. Most of them relate to hierarchical
database design but you may find them useful anyway. The last article
shows a way to do
http://www.easycfm.com
;)
Pablo
- Original Message -
From: Jake McKee [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:16 PM
Subject: Recursion Tutorial?
Hi there, I am hoping someone can point me in the right direction. I am
looking for good sources of
PROTECTED]]
Sent: Friday, September 13, 2002 1:41 PM
To: CF-Talk
Subject: RE: Recursion
All,
Thank you for your responses to my inquiry.
As it turns out, the CFSCRIPT option is not viable because the
point of the recursion was querying a database for records that
represented subordinate
PROTECTED]]
Sent: Thursday, September 12, 2002 2:23 PM
To: CF-Talk
Subject: RE: Recursion
I wrote this really neat recursive function using the
cffunction tag on my development system which is
running
CFMX on WindowsXP Pro. When I ported to the
operational host
(third party), I discovered
Subject: Re: Recursion
Rewrite the function using the CFScript UDF syntax. Theoretically it
should work fine, but it may depend on what you are doing inside the
CFFunction tag.
At 01:31 PM 9/13/2002 +0600, you wrote:
Hello all,
I wrote this really neat recursive function using
I think UDFs do not do recursion.
not true.
nice example:
http://www.cflib.org/udf.cfm?ID=600
__
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
cf_eathat/cf_eat
-Original Message-
From: Rich Wild [mailto:[EMAIL PROTECTED]]
Sent: 13 September 2002 10:56
To: CF-Talk
Subject: RE: Recursion
I think UDFs do not do recursion.
not true.
nice example:
http://www.cflib.org/udf.cfm?ID=600
S. Isaac Dealey wrote:
Before you give up... There's a couple of things you can
do for the
recursion in the db... One is to create a cross-reference
table which shows
the parent-child relationship between all records in the
table...
Alternatively, you could try this:
cfset rs =
All,
Thank you again for all of your suggestions. As time allows, I will probably play
with all of them just to learn how.
It is wonderful to have such support.
Take care,
Robert
-- Original Message --
From: S. Isaac Dealey [EMAIL PROTECTED]
Reply-To:
I wrote this really neat recursive function using the
cffunction tag on my development system which is running
CFMX on WindowsXP Pro. When I ported to the operational host
(third party), I discovered that they were running a previous
version of CF (I do not know which) which does not
UDF
- Original Message -
From: Robert Polickoski [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, September 13, 2002 3:31 AM
Subject: Recursion
Hello all,
I wrote this really neat recursive function using the cffunction tag on
my development system which is running CFMX
Rewrite the function using the CFScript UDF syntax. Theoretically it
should work fine, but it may depend on what you are doing inside the
CFFunction tag.
At 01:31 PM 9/13/2002 +0600, you wrote:
Hello all,
I wrote this really neat recursive function using the cffunction tag on
my
PROTECTED]]
Sent: Thursday, September 12, 2002 2:23 PM
To: CF-Talk
Subject: RE: Recursion
I wrote this really neat recursive function using the
cffunction tag on my development system which is running
CFMX on WindowsXP Pro. When I ported to the operational host
(third party), I discovered
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 2:23 PM
To: CF-Talk
Subject: RE: Recursion
I wrote this really neat recursive function using the
cffunction tag on my development
/
-Original Message-
From: Robert Polickoski [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 13, 2002 1:41 PM
To: CF-Talk
Subject: RE: Recursion
All,
Thank you for your responses to my inquiry.
As it turns out, the CFSCRIPT option is not viable because the
point of the recursion
A discussion on this went on just last week. Check the archives. Searching for
''nested set'' should bring it up.
I wrote a freebie, ultra-basic cms that handles it in three different ways, depending
on your resources. Tear it up to see how it works.
http://makeashorterlink.com/?E19D21CF
is the exit condition being met correctly in the recursive function?
christopher olive
cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com
-Original Message-
From: Michael Corrigan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March
, Suite 200
Lombard, IL 60148
630-627-5055 ext.-136
630/627-5255 Fax
- Original Message -
From: Christopher Olive
To: CF-Talk
Sent: Thursday, March 21, 2002 1:05 PM
Subject: RE: Recursion issue
is the exit condition being met correctly in the recursive function?
christopher
PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 12:31 PM
Subject: Re: Recursion issue
From what I can tell yes. It displays the information the way it is
supposed to and it appears that the browser stops 'thinking' and I can keep
working in the app, but a few minutes later
At 11:33 AM 2/26/2002, you wrote:
to populate this struct, but my UDF does not continue looping after the
first recursion call.
Oh man, I spent most of yesterday debugging a seemingly simple recursive
UDF, I was so sure it was all correct, just couldn't work out what was
going on. Until I
Lets see your UDF. maybe there is a bug.
On Mon, 25 Feb 2002, Paul Wille wrote:
Hello everyone,
I have a flat table of employees (referenced by employee number) that I
need to build a dynamic Org chart for. The necessary table information
is as such:
empNum fName lName
Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 2:41 PM
To: CF-Talk
Subject: Re: Recursion of UDFs
Lets see your UDF. maybe there is a bug.
On Mon, 25 Feb 2002, Paul Wille wrote:
Hello everyone,
I have a flat table of employees (referenced by employee number
73 matches
Mail list logo