O$ Node Full Path

Panikos Stavrou pstavrou.omnis at cytanet.com.cy
Mon Apr 6 15:46:53 EDT 2009

thx david,
i already implemented something similar in a while loop
(apparently when $nodeparent=0 then it's the root),
saved each node and then concatenated the result

i was looking for a one-liner method or property,
thx tho

Barnett, David wrote:
> Re: "i like when the user clicks on a node to have the full
> path from the node selected back to the root node."
> panikos:
> A simple loop will help build up the 'path'. In the $event method of your tree, put:
> On evClick
>   Do method getNodeFullName ($cobj.$currentnode()) Returns #S3
>   OK message  {Fullpath=[#S3]}
> Add a method to the tree object called getNodeFullName, with with 1 param, pNodeRef (itemref), and 1 local var, lFullName (char(10000)) long enough to hold the full path text. In that method put: 
> If pNodeRef.$level>1
>   Do method getNodeFullName (pNodeRef.$nodeparent) Returns lFullName
>   Quit method con(lFullName,'/',pNodeRef().$name)
> Else
>   Quit method pNodeRef.$name()
> End If
> Note that the method is called recursively passing the parent node each time until you reach the top level node. It builds up the path with the name from each level of the tree. Adapt as you wish.
> David
> David Barnett
> Senior Software Engineer
> Advertising Solutions
> Harris Corporation, Broadcast Communications
> T: +1-212-303-4273
> E: David.Barnett at harris.com  
> www.broadcast.harris.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

More information about the omnisdev-en mailing list