how to set lead select by reading values from another node
i have a table with multiple rows and columns, i have to implement the search functionality and provide 2 links 'previous' and 'next' to move from one result to the other in the table.
in other words, when i do a search, if the string is found ( and here i store the index in the IndexNode), the corresponding row is highlighted(lead selected). if there are multiple results, it highlights the first result row. once i click on 'Next', it must go to the next row which matches the search string. likewise, when I click on 'Previous' link, it must go to the previous result row and highlight it.
i have implemented the search part and am able to highlight the result rows.
My Context looks like this:
DataNode |-Name |-Age |-Company IndexNode |-Index
How do i implement the link part of it? I have to read the current lead selected row from the table, compare this with the index node, do a +1 or -1 (for 'next' or 'Previous' links respectively), get the value in that index attribute and use that value to set the lead select in the Data Table.
Please help. If you are not able to get my question, please let me know so I can rephrase the entire thing.
Armin Reichert replied
onNext(): wdContext.nodeIndexNode().moveNext(); wdContext.nodeDataNode().setLeadSelection ( wdContext.currentIndexNodeElement().getIndex() ); onPrevious(): wdContext.nodeIndexNode().movePrevious(); wdContext.nodeDataNode().setLeadSelection ( wdContext.currentIndexNodeElement().getIndex() );