cancel
Showing results for 
Search instead for 
Did you mean: 

Collapse All tree - WD for ABAP

Former Member
0 Kudos

Hi All,

do you know how i can access the "Collapse All" functionality which appears on the view of WDR_TEST_EVENTS( wd component) -> Tree_Static ( WD view), only at run time. i would like to see how it has been implemented in WbDynPro for ABAP.

Thanks and regards,

Anoop

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Anoop,

I know how to do this in WD Java, probably WD ABAP has something similar.

So, tree node UI element has a property isCollapsed or isExpanded bound to boolean context attribute. So if you recursively traverse context node / elements and set corresponding attribute to false (for expanded) / true (for collapse), you should get "Collapse All" behavior.

VS

thomas_szcs
Active Contributor
0 Kudos

Hi Valery,

Yes, this would work in WD ABAP as well. I have no coding at hand, but it should not be difficult to recursively loop through the context.

Kind regards,

Thomas

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

CollapseAll is an innate feature of all trees. As a developer you don't need to implement anything. It is always there to assist your user's. ExpandAll on the other hand only appears if the event with the same name was bound to an action and the functionality implemented by the developer. The reason is that for some trees, expanding everything is not possible or desired (recursive trees, tree's with a very high depth).

Kind regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

what I am using in my application is "TreeByNestingTableColumn" and here this "collapse all" is not present. May be you can tell me where exactly I can set its visibility to yes, or something like that. Or if you wish to I can send you more information about our application via MAIL, so that you can have a look and answer few of my queries.

Thanks and Regards,

Anoop

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Did you set titleVisible = visible?

Kind regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Actually i did find this property, "titleVisible" in the examples of WD Trees' but in my application this property is not at all there, actually I have embedded a tree in a column( Table column).

Regards,

Anoop

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Oh sorry. I thought you were using a Tree. The examples in WDR_TEST_EVENTS use an actual Tree, not a Table. For a table, such a functionality is not automatically provided, since there is no toolbar in all cases. You will have to place a button on the table's toolbar and implement the functionality. It really depends on the scenario on whether someone should use a Tree or a Table with a hierarchy column. The advantage of the Tree is that it is a real Tree with many more features than the Table will ever over. On the other hand, the table allows of a better integration with detail table for Tree node - since these are just additional fields. Moreover, the Table allows you to scroll large content and offers a user the opportunity to utilize not just the LeadSelection, but the Selection as well.

Kind regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

May be you can tell me how I can access the implementation of "Collapse All" in WDR_TEST_EVENTS -> Tree_Recursive( view). This may help me in getting on some info on how exactly it has been implemented, moreover I will get info on data removal from context nodes while doing "Collapse All".

Regards,

Anoop

thomas_szcs
Active Contributor
0 Kudos

Hi Anoop,

Unfortunately, the Tree works completely different compared to the hierarchial column of the Table. It is impossible to reuse this functionality. Furthermore, the coding in question is not accessible from outside since it resides in local classes of a certain class.

Kind regards,

Thomas

Former Member
0 Kudos

I guess I will have to code it right from the scratch then.. Anyways thanks Heidi and Thomas.

Regards,

Anoop

Former Member
0 Kudos

Hello Anoop,

do you mean the property expanded of TreeNodeType? Have a look here: http://help.sap.com/saphelp_nw04s/helpdata/en/c0/088b41b4b3b25fe10000000a1550b0/frameset.htm

So you could look at the EXPANDED methods of class CL_WD_TREE_NODE_TYPE in SE24.

Regards, Heidi