I am trying to allow the user to delete emails from a List View, but when they click the imageview the event does not fire. any ideas?
B4X:
Sub LoadEmailList
Dim su As StringUtils
EmailList = su.LoadCSV(Main.WrkFld, csvName, csvChar)
Dim SortedList As List
SortedList.Initialize
For Each Row() As String In EmailList
For Each Col As String In Row
Dim s As String = SharedMod.DecToString(Col)
If s <> "" Then
SortedList.Add(s)
End If
Next
Next
SortedList.Sort(True)
For i = 0 To SortedList.Size - 1
lvEmailTo.Items.Add(GetEmailToPane(SortedList.Get(i), SortedList.Get(i), "cancel_48.png"))
Next
End Sub
Sub GetEmailToPane(Tag As String, Label As String, ImageName As String) As Object
Dim lbl As Label
lbl.Initialize("lblNode")
lbl.Text = Label
lbl.Tag = Tag
lbl.Font = fx.CreateFont("System", 14, False, False)
lbl.TextColor = fx.Colors.Black
Dim IV1 As ImageView
IV1.Initialize("IVNode")
IV1.Tag = Tag
Dim Img As Image = fx.LoadImage(File.DirAssets,ImageName)
IV1.SetImage(Img)
Dim AP As AnchorPane
AP.Initialize("")
AP.Tag = Tag
AP.AddNode(IV1,0,0,25,25)
AP.AddNode(lbl, 30,1.5,300, 15)
Return AP
End Sub
Sub lblNode_Click (EventData As MouseEvent)
Log("lbl clicked")
End Sub
Sub IVNode_Click (EventData As MouseEvent)
Log("x clicked for deleting")
End Sub