cancel
Showing results for 
Search instead for 
Did you mean: 

Default Tree Element Selection

bjorn-henrik_zink
Active Participant
0 Kudos

Hi,

please help me selecting a tree element by default. I have a tree reflecting a folder structure. Based on user information I want to mark/select a certain folder (tree element) when the user opens the tree. Is this possible? How? Code examples are greatly appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please refer this link for Mana's Reply-

Regards,

Lekha.

bjorn-henrik_zink
Active Participant
0 Kudos

Hi Lekha,

I read the link you posted and found something about setting the lead selection then the parent is marked. However, the thread did not say where I should add the coding nor what the coding looks like. Any suggestions on that?

It is only the top node that I want to have selected by default and therefore it does not work when I have the lead selection checked.

Thanks.

Answers (1)

Answers (1)

bjorn-henrik_zink
Active Participant
0 Kudos

I solved the problem by setting the lead selection of the first child folder of the root. This was done in the supply function of the folder in the component controller.

...

node->bind_table(

new_items = itab_folderelement

set_initial_elements = abap_true ).

IF wd_this->is_root = abap_true.

node->set_lead_selection_index( 1 ).

wd_this->is_root = abap_false.

ENDIF.