on 04-15-2014 6:21 PM
Hi,
I created a Web Dynpro component that does many things. One feature is do display information in a Tree UI element. I use the TreeNodeType and recursive context node to build a nice tree representing what the customer wants. Since this tree could get very large, I implemented a search feature to help users locate items in the tree. When found, I expand the tree, and call call set_lead_selection passing in the element where found. This seems to generally work fine (and highlights the highlights the desired TreeNodeType), but only when going farther down in the tree. If I change the search so that it should find something "higher up" in the tree, the search still works, and it finds the data, but calling the set_lead_selection does not seem to unhighlight a previously located TreeNodeType. I have added code to loop through all elements in the tree and call set_selected( ABAP_FALSE). This didn't seem to help. If I use the mouse and manually click on the root of the tree, it seems deselect previously highlight TreeNodeTypes, and the highlighting works again (but still just going forward).
I implemented a Find Next feature that starts where the last search left off, and looks farther down the tree. This works more consistent, but still occassionaly seems to "forget" to unhighlight a previously located TreeNodeType/element.
What am I doing wrong?
I am attaching a screen shot.
Hi Perry,
Before setting the lead selection of found result, try to clear all the selected elements from context node.
Sample:
data lo_node type ref to if_wd_context_node.
lo_node = wd_context->get_child_node ( name = 'MY_NODE' ).
"Clear the current selection
lo_node->clear_selection( ).
" now, set the lead selection
lo_node->set_lead_selection( .... )
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Rama for the fast reply.
I had tried calling the clear_selection( ) method from the node of my tree, unfortunately, I could see no improvement. The only thing that seems to reset the tree is manually clicking on the root of the tree. Nothing I can find programmatically will properly deselect the previously highlighted tree node (unless the next thing I find is "lower" in the tree). That is, my search only highlights properly when the next node/element found is lower in the tree. I always start the search at the root.
It is very frustrating because I believe the users will be using this Search feature a lot.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.