Private Sub CellClicked (pnl As B4XView, LongClicked As Boolean)
If DateTime.Now < LastCellClickEvent + 20 Then Return
LastCellClickEvent = DateTime.Now
Dim column As B4XTableColumn = pnl.Parent.Tag
Dim Row As Int = pnl.Tag - 1
Dim e As String
If Row = -1 Then
If LongClicked Then
e = "_headerlongclicked"
Else
e = "_headerclicked"
HeaderClicked(column)
End If
If xui.SubExists(mCallBack, mEventName & e, 1) Then
#if B4i
If LongClicked Then FeedbackGenerator.RunMethod("impactOccurred", Null)
#End If
CallSub2(mCallBack, mEventName & e, column.Id)
End If
Else
Dim RowId As Long = VisibleRowIds.Get(Row)
lRowID = RowId '<<<< added to pick up the SQLite rowid