PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → TreeView Control - Getting the selected leaf
TreeView Control - Getting the selected leaf
Started by GFreire, Oct., 09 2024 1:56 PM - 1 reply
Registered member
2 messages
Posted on October, 09 2024 - 1:56 PM
After a lot of testing i'm having trouble getting the selected leaf from a TreeView control on WEBDEV26.

I can get the full path to the leaf with
Info(TreeSelect(TREE_MyTree))


However, TreeIdentifier returns a blank value with the code below, as do most functions where i try to use TreeSelect(TREE_MyTree) as the path to the clicked item.

Info("The Index is: "+TreeIdentifier(TREE_MyTree,TreeSelect(TREE_MyTree)))


What i am looking for is a function that returns the visible value of the Leaf or Node as a string. If there is another way to get this end result i can work with it.
Registered member
2 messages
Posted on October, 10 2024 - 6:03 PM
I ended up using a workaround with ExtractString().
For those in a similar situation to mine i leave the code below:
MyPath is string = TreeSelect(TREE_MyTree)

Leaf is string = ExtractString(MyPath,WordCount(MyPath),TAB)
//Leaf outputs the string from the tree item that has been clicked clicked, wether it's a leaf or a node