cancel
Showing results for 
Search instead for 
Did you mean: 

How to expand a tree component

Former Member
0 Kudos

Hello,

I'm using a Tree component in my mainview. When clicking on a node, I get to expand the tree.

Now, I'd like to be able to search a node. For example, when I search for a node "material", a popup appears with all the nodes matching "material". After validating my selection, the popup closes itself and returns to the mainview. At this moment, the tree has to be expanded at the selected node, as if I had clicked on it...

I hope I've been clear enough. If not, feel free to ask 😃

Thanks for any help you can provide.

C.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. Select the row or node under which you want to search the corresponding node. for ex: root node

2. Press the button to open the search popup.

3. enter the Search input and press search. for ex: "material*"

4. Now with the help of method "get_static_attributes_table" of interface if_wd_context_node get all the elements of context node.

5. Now, Loop through elements table and build table for all elements having value for attributes starting with material like material_pepsodent, material_nike, material_1 etc.

6. Bind this table to the result table. Also keep the element index in the result table.

7. Now depending upon the user selection from result table, select the corresponding element using sel_lead_selection ( index = <selected_element> )

8. Also, you have to saet the property "expanded" equal to true. for this element as well as their corresponding parent element.

Please note that in WebDynro ABAP there is no event like "OnKeyPress". So do not expect that as you press "mat" result will be filtered for "mat".

Thanks,

Rahul

Former Member
0 Kudos

Hi!

Thanks for your answer 😃

Actually, I wasn't very clear in my post. Sorry. I got to do everthing excepted the "expand" thing.

I was thinking about reproducing the "click node" event. Didn't think about just changing the "expanded" property.

I'm gonna try this out.

Thanks again.

C.

Answers (0)