woniol Active Member Licensed User Longtime User Jan 4, 2016 #1 Hi, is there a way to set item as Selected by code in TreeView ?
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2016 #2 Try this: B4X: Dim jo As JavaObject = TreeView1 jo.RunMethodJO("getSelection", Null).RunMethod("select", Array(TreeItem1)) Upvote 0
Try this: B4X: Dim jo As JavaObject = TreeView1 jo.RunMethodJO("getSelection", Null).RunMethod("select", Array(TreeItem1))
woniol Active Member Licensed User Longtime User Jan 4, 2016 #3 Sorry, it doesn't work. B4X: java.lang.RuntimeException: Method: getSelection not found in: javafx.scene.control.TreeView Upvote 0
Sorry, it doesn't work. B4X: java.lang.RuntimeException: Method: getSelection not found in: javafx.scene.control.TreeView
woniol Active Member Licensed User Longtime User Jan 4, 2016 #4 woniol said: Sorry, it doesn't work. B4X: java.lang.RuntimeException: Method: getSelection not found in: javafx.scene.control.TreeView Click to expand... But it works fine like this: B4X: Dim jo AsJavaObject = TreeView1 jo.RunMethodJO("getSelectionModel", Null).RunMethod("select", Array(TreeItem1)) Thanks for your help Upvote 0
woniol said: Sorry, it doesn't work. B4X: java.lang.RuntimeException: Method: getSelection not found in: javafx.scene.control.TreeView Click to expand... But it works fine like this: B4X: Dim jo AsJavaObject = TreeView1 jo.RunMethodJO("getSelectionModel", Null).RunMethod("select", Array(TreeItem1)) Thanks for your help