cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro Tree - Collapse all

Former Member
0 Kudos

Hi,

How can I call the "collapse all" action of the tree element the in code?

Thanks,

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello Aviad,

Let say you have node Entries and subnode SubEntries (recursive to Entries). Attribute IsExpanded is mapped to expanded property of treeNodeType. So you have to iterate and set appropriate status (true to expand or false to collapse) as Valery suggested in early mentioned post.


  private void setNodeStatus(IPrivateXXX.IEntriesNode node, boolean status) {
	for(int i=node.size();i>0;) {
		final IPrivateXXX.IEntriesElement element = node.getEntriesElementAt(--i);
		element.setIsExpanded(status);
		if(element.getIsNode()) {
			setNodeStatus(element.nodeSubEntries(), status);
		}
	}
  }

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Is there a way to call the event for "collpase all" in the code?

Thanks,

Aviad

Answers (1)

Answers (1)

Former Member
0 Kudos

Aviad,

Try this

VS

Former Member
0 Kudos

OK, Thanks for this.

But, isn't there an easy way to 'click' on the "Callapse All" icon of the tree in code?

Cheers,

Aviad

Former Member
0 Kudos

There is a collapse button in tree control, it seems to do exactly the same

However, this functionality is not exposed to code directly.

VS