swChef Active Member Licensed User Longtime User May 19, 2021 #1 When the SelectedItem is programmatically set, the TreeTableView does not scroll the item into view. But it does highlight. Unlike some other view controls, the B4J TreeTableView does not have a ScrollTo (exposed). [Found partial solution via searching] Use JavaObject and access the scrollTo [Reviewed JavaFX source for TTV to realize the following complete solution] B4X: Copy Dim jo As JavaObject = TreeTableView1 ' the TreeTableView Dim iTTVindex As Int = jo.RunMethod("getRow",Array(tti)) ' for TreeTableItem tti jo.RunMethod("scrollTo",Array(iTTVindex)) Last edited: May 30, 2021
When the SelectedItem is programmatically set, the TreeTableView does not scroll the item into view. But it does highlight. Unlike some other view controls, the B4J TreeTableView does not have a ScrollTo (exposed). [Found partial solution via searching] Use JavaObject and access the scrollTo [Reviewed JavaFX source for TTV to realize the following complete solution] B4X: Copy Dim jo As JavaObject = TreeTableView1 ' the TreeTableView Dim iTTVindex As Int = jo.RunMethod("getRow",Array(tti)) ' for TreeTableItem tti jo.RunMethod("scrollTo",Array(iTTVindex))