dbtreeview bean

Is it possible to select a node by method?

I mean the following:
When I click in the dbtreeview bean, I see that the node becomes grey( or blue depending what L&F you use)

this node than fires a search script that fills a tabpanel with data.
I can mimick the selection of a node, by giving the PK to the search method, so the tabpanel is than filled with the right data, but the node in the dbtreeview stays on the prior selected node.

Anyone know how to do this?

selectedPath (or something like that) is your friend…

It’s possible, I use it.

yeah, I tried that, but I don’t see the node really selected.

can you explain, what you do?

ah got it, I have to provide the PK of the folder in an array.

thanks Patrick, you got me on the right track!

oke, bumped into another issue.
I can set the the root node like this:

elements.dbtreeview.selectionPath = [2112]

but if node is under a root node, I can’t do this:

elements.dbtreeview.selectionPath = [2113]

2113 is the PK of the node, as a child under 2112

Out of my head, I think you have to provide the path as

elements.dbtreeview.selectionPath = [2112, 2113]

But the problem is, that where I am in my code, I don’t know the path!

If you don’t know where you want to go, you have a problem. :lol:

Your tree data should be a parent/child structure, right? So can’t you just walk your ID up to the top and get all parents?