For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
Vishnu, tell us your jdev version, please!
You should read better describe what you want to do (maybe read https://tompeez.wordpress.com/2016/10/14/how-to-ask-questions-in-otn-spaces/ ).
If you set a child node as selected the parent node doesn't discloses itself, you have to do it yourself. Once all nodes to the child are disclosed, you don't see the 'go to top'. If you know the child node you create a new RowKeySet and add the child node to it. then you traverse the tree up and add each parent node to the rowKeySet until you reach the root node which you have to add too. This should do it. For an implementation you can look at https://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_disclose_a which shows how to implement this.
Timo
Apologize for not putting the question clearly.
I'm using Jdev 11.1.1.7.
Yes, I do understand that I have to traverse through the tree and find respective parents to disclose a particular node.
But my question is regarding setting selected row and not disclosed rows. I'm able to disclose rows as required.
Upon setting selected keys and refreshing the tree, I don't see entire tree but only the selected node. (with a blue arrow as shown in my screenshot)
Is there a way to avoid this behavior, so that the blue arrow doesn't appear and just required row is selected and entire tree is displayed as-is.
-Vishnu
Yes, the blue arrow means that you have set the root node and not selected node.
How have you implemented the selection?
Thanks for the responses, Timo.
I've noticed that it is not because of selected node but because of 'setFocusRowKey()'.
I'm trying to disclose necessary nodes, select a particular row and bring the focus to that row. (automatically scroll to that row)
disclose and select are working fine, but focus is bringing in the blue arrow with 'go to top'.
So is the problem solved?
I made a small test case which is working fine. I can search for a node in a tree and select it.
My search is for the LocationId. I enter 1200 and on click on select the node is searched the tree and selected
Appreciate your interest.
No, problem isn't solved.
It is actually an extension to the example you used. Let's say there are 100s of rows that aren't visible without scroll, and the selected row is somewhere at the bottom. To focus the selected row, I'm using setFocusKey(), which brings in the arrow.
Hi Vishnu,
I have used the below code to show the selected row in a table which is not visible. It should be something similar for tree component.
The method gets the current row key from the iterator and makes the table to scroll / brings to the top.
Thanks
Morgan.
thank you, Morgan. That worked.
Glad I could be of some help
Cheers
Morgan