On 24/05/2006, at 12:18 AM, zefer wrote:

> I have tried using those methods but have had strange results. For
> example, the recordset returned from getAncestors() is empty when I
> pass the objectid for a page (such as "some page" in structure above).

You shouldn't pass the id of the dmHTML page, but instead the id of  
the dmNavigation node it lives in (the current page's nav node id  
lives in request.navid). The distinction is subtle if you're starting  
out with Farcry, and it *should* probably be documented on both the  
dmNavigation and tree API pages.

To answer your question, fetching the ancestors of the current page  
is only a matter of:

<cfset ancestors = application.factory.oTree.getAncestors 
(objectid=request.navid) />

If you want to find the ancestors of an arbitrary dmHTML page (or any  
piece of tree-based content) use dmNavigation's getParent method to  
first find the ID of the nav node it lives in, and pass the result to  
getAncestors:

<cfset parentNavId = createObject("component",  
application.types.dmNavigation.typePath).getParent 
(objectid=somePageId) />
<cfset ancestors = application.factory.oTree.getAncestors 
(objectid=parentNavId) />

HTH.

Regarding the documentation of these methods, I'm not sure if CFCDoc  
supports code examples in the hint's of functions but it would be  
good idea to include these type of examples in the dmNavigation and  
tree API docs.

-- tim lucas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/farcry-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to