cancel
Showing results for 
Search instead for 
Did you mean: 

Tree parent path

Former Member
0 Kudos

Hi Experts,

I am using Tree UI element doing KM application. My tree structure is

SAP--folder

-SDN-folder

-


forumn---folder

thread-folder

--a)1.txt

-- etc

In my Km path look like <root folder>/SAP/SDN/forumn/thread/

I need to select thread folder it will display all files under thread folder only. my question is if i select thread folder. how to i get entire path in the tree struture?? (tree structure is dynamic) i got tree structure? i am struggling getting the path from tree structure?How to do that? give your suggestions?

Regards,

Manivannan P

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Custom way of achieving this: Create one more context attribute in your TreeNode. And evertime whenever you populate an entry in the tree node then append the parent Id to that element in this context attribute as below.

folderContentElement.setPath(folderContentElement.getPath()"/"folderContentElement.getParentId);

So whenever you want the path of particular tree node element, just call the getter method of Path attribute.

It gives you the complete path.

SAP>SDN>Forums-->Thread..etc..

Regards,

Charan

Former Member
0 Kudos

Hi charan,

Thanks for your reply. I got a solution

Regards,

Manivannan P

Answers (1)

Answers (1)

Former Member
0 Kudos

Armin

Former Member
0 Kudos

Hi Armin,

I gone through the below thread


List path = new ArrayList();
IWDNodeElement e = wdContext.node<TreeDataSource>().getTreeSelection();
while (e != null)
{
  path.add(0, e);
  e = e.node().getParentElement();
}

If i use this code . it will go to the infinite loop and server is getting stopped. any other solutions??

Regards,

Manivannan P