cancel
Showing results for 
Search instead for 
Did you mean: 

Search - Next/Previous

Former Member
0 Kudos

Hi experts,

I have a requirement where I am displaying dynamic recursive tree and using supply functions to populate data of nodes and sub-nodes. Also I have handled events 'On Expand' for nodes and subnodes and populated data.

Now I need to implement Search/Search Next/Previous. When user enters any string and hit SEARCH, node/subnode which has similar text should be highlighted.

When user hits search, I have written code to capture the index of the the final internal table and show final internal table up to that point. But the problem is 'as the code is not in supply function', when I bind the node, the tree strcuture is lost and all the nodes/subnodes are shown as different records.

I have checked SDN and could not find any post.

Please suggest me how can I achieve this.

Regards

Vasu

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hi,

where I've had similar requirements (searching a tree and highlighting) what I've done whilst building the tree is create a flat internal table which contains all the data that I want to search and a reference to the context element that is that "node" in the tree.

Thus rather than searching the tree, I just search the table, then select the item in the tree. (that's the tricky bit!) To select in the tree requires all parent nodes to be lead selected too - and no child node.

a simple recursive routine can ensure all parent elements are lead selected in their context nodes, and you can easily set the current node to ensure no children are lead selected.

search next, previous then just steps through the flat table, and highlights in the tree.

Downside - need to replicate your data... hope your tree isn't too big!

Cheers,

Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

requirement cancelled