Wish B4XTable - CellClicked event

LucaMs

Expert
Licensed User
Longtime User
It would have been useful if the event also provided the value of the clicked cell:
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long, Value As Object)
so you don't have to write the following code:
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
   Dim RowData As Map = B4XTable1.GetRow(RowId)
   Dim cell As String = RowData.Get(ColumnId)
   Log(cell)
End Sub
I assume that due to backwards compatibility it is now no longer possible to change the signature of that event.
You could create a CellClicked2 or CellClick event.
 

Mahares

Expert
Licensed User
Longtime User
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long, Value As Object)
I just saw this thread:. Not necessarily. You can still show Col_2 cell value even if Col_1 was clicked the way it is now. Usually it is the value of the cell you click that you are interested in, but what if Col_2 is disabled, you cannot click on it, but if you click on a cell in Col_1, you can still get the value in Col_2 cell.
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long) 
   Dim RowData As Map = B4XTable1.GetRow(RowId)
    Dim cell As String = RowData.Get("Col_2")  'You can still show Col_2 cell value even if Col_1 was clicked
'   Dim cell As String = RowData.Get(ColumnId)
   Log(cell)
End Sub
 

LucaMs

Expert
Licensed User
Longtime User
I just saw this thread:. Not necessarily. You can still show Col_2 cell value even if Col_1 was clicked the way it is now. Usually it is the value of the cell you click that you are interested in, but what if Col_2 is disabled, you cannot click on it, but if you click on a cell in Col_1, you can still get the value in Col_2 cell.
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
   Dim RowData As Map = B4XTable1.GetRow(RowId)
    Dim cell As String = RowData.Get("Col_2")  'You can still show Col_2 cell value even if Col_1 was clicked
'   Dim cell As String = RowData.Get(ColumnId)
   Log(cell)
End Sub
Yes, it is already possible to get the cell value, but doesn't it seem simple and mostly logical to you to get it directly as a parameter in the Click event? :oops:
I would say this is indisputable.
 

Mahares

Expert
Licensed User
Longtime User
It is not a bad wish, but maybe we should let Erel answer this. Why do I have to answer. After all it is his library. I hope he reads it and respond.
 
Top