cancel
Showing results for 
Search instead for 
Did you mean: 

Open 1st level of tree table

former_member182374
Active Contributor
0 Kudos

Hi all,

I've created a TreeTable similar to the TreeTable in this tutorial:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/de59f7c2-0401...

By default the tree is not expanded and looks like this:

http://img519.imageshack.us/my.php?image=11kc7.jpg

i want to expand the first level so the TreeTable will look like this:

http://img363.imageshack.us/my.php?image=22oi3.jpg

I tried to set the 'expanded' property of the 1st element to 'true' but all it does is changing the arrow direction (from left to bottom) without actually expanding the node...

Also, I tried to call the LoadEntries action after populating the context - nothing happens.

Which property do I need to change in order to expand the first level?

Thanks,

Omri

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182374
Active Contributor
0 Kudos

Solved it on my own:

In the wdDoInit I call the load children action with the 1st element as parameter:

onActionLoadChildCatalogEntries(null, wdContext.nodeCatalogEntries().getCatalogEntriesElementAt(0));

in the onActionLoadChildCatalogEntries method I check if this is the first node (by the element's ID) and set the setChildrenLoaded property:

if (element.getID().equalsIgnoreCase("1000")) { // 1000 is the first ID (in my case the first ID is constant)
   element.setChildrenLoaded(false);
} else {
   element.setChildrenLoaded(true);
}

In the addCatalogEntries method I set the expanded property of root to true:

if (parentId.equalsIgnoreCase("ROOT")) {
   newCatalogEntriesElement.setExpanded(true);
}

Not the best solution but it's working

Omri

Former Member
0 Kudos

unable to open the link for image.