PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → TreeView Control - Getting the selected leaf
TreeView Control - Getting the selected leaf
Débuté par GFreire, 09 oct. 2024 13:56 - 1 réponse
Membre enregistré
2 messages
Posté le 09 octobre 2024 - 13:56
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.
Membre enregistré
2 messages
Posté le 10 octobre 2024 - 18:03
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