afcontext in AFTreeview.AFSelect method

Discussion created by aabrodskiy on Nov 5, 2012
Latest reply on Nov 5, 2012 by aabrodskiy

I'm using the AFTreeView UI component and trying to set a selected node to the one I need. The problem is that the one I need is a Reference somewhere in the hierarchy.


So I'm calling afTreeView.AFSelect(db.Elements[FQN], null, FQN) and it does locate the element, but not the particular Reference of it provided in the FQN path. Instead it always locates the first "main" reference of this element in the hierarchy.


Documentation does suggest that there is a second parameter afcontext, which could actually help finding exact reference.


Here is what documentation says about the Parameters of AFSelect Method:

Type: System..::.Object
The object to select.
Type: System..::.Object
The context of the selection. When an item can appear in multiple places in the tree, the context aids in selecting the correct location. When a context is provided, the selection mechanism will prefer finding the specified afobject under tree node represented by the context.
Type: System..::.String
A path to the object can server as a backup mechanism for finding the specified object, or, can be used when the object could appear in multiple places in the tree.

Can anyone shed some light on this afcontext parameter? Or give an example of using it? Couldn't find any clue in the AF SDK UI manual.


Thanks in advance