B4J Question How to get some information from multiple selected object in tableview?

prhymery

Member
I made a tableview and I stored numbers in each cells as object

when I clicked some cell, I got number(object info) of each cells by using below method

B4X:
Sub TableView1_SelectedCellChanged (RowIndex As Int, ColIndex As Int, Cell As Object)
    Log(Cell)
End Sub
Then, I am trying to get numbers (objects info) during the multiple selection

is there any way to get information from multiple selected cells?

I used below code from table example

B4X:
Dim jotable As JavaObject=TableView1
   
    Dim joSelMode As JavaObject
    joSelMode.InitializeStatic("javafx.scene.control.SelectionMode")
   
    Dim tvSelModel As JavaObject = jotable.RunMethodJO("getSelectionModel", Null)
   
    tvSelModel.RunMethod("setSelectionMode",Array(joSelMode.GetField("MULTIPLE")))
 
Last edited:

prhymery

Member
Thank you for your quick response
Actually, I already made a node like below code
B4X:
    For rowIndex = 1 To 16
        Dim row(TableView1.ColumnsCount) As Object
        Dim num As Int
        If rowIndex = 1 Then
        num=rowIndex
        Else If rowIndex <> 1 Then
            num = (32*(rowIndex-1))+1
        End If
            For c = 0 To TableView1.ColumnsCount - 1
                row(c) = num + c
            Next
        TableView1.Items.Add(row)
    Next
you mean, should I add labels?
 
Top