An iTableView has identical custom cells. Each cell is loaded with the same layout containing two labels. I wish to retrieve the second label text when the cell is clicked.
The 'sender' object returned in the TableView1_SelectedChanged event always seems to be an iTableView despite clicking on a label.
How is this done? I am sure I am missing something really simple here?
The 'sender' object returned in the TableView1_SelectedChanged event always seems to be an iTableView despite clicking on a label.
How is this done? I am sure I am missing something really simple here?
B4X:
Private Sub CreateItem (index As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Width = 100%x
p.Color = Colors.Black
p.Height = TableView1.RowHeight
p.LoadLayout("ecam_cell")
lblECAM.Text = Warnings.GetString("ECAM_Warning")
lblSystem.Text = Warnings.GetString("System")
p.Tag = lblSystem.Text
Return p
End Sub
Sub TableView1_SelectedChanged (SectionIndex As Int, Cell As TableCell)
Dim lbl As Label = Sender
Dim no As NativeObject = lbl
Dim Parent As Panel = no.GetField("superview") 'get the label's parent
Dim FindSys As String = Parent.Tag
Log(FindSys)
End Sub