Hi All.
I have this code:
this code trigger the event:
So if in my select i read n. records, work, if i have in my select one result ( 1 record ) work the first time, but if i repeat a select that give me again 1 record the event no Trigger.
i think that the problem is inside CustomListView here:
Why this line:
Thank you
I have this code:
B4X:
................
Dim cd As CardData
cd.Initialize
cd.Text = cs
cd.Text1 = cs1
cd.Text2 = cs2
cd.riga = i
cd.passa_id = m.Get("titolo")&"|"&m.Get("prezzo_mini")&"|"&m.Get("prezzo_max")&"|"&m.Get("tipo_pizza_mini_maxi")&"|"&m.Get("ordine")
cd.tipo_menu = tipo_menu
cd.tipo_immagine = m.Get("tipo_immagine")
Dim p As B4XView = xui.CreatePanel("")
p.Color = Colors.ARGB(255, 160,68,29)
p.SetLayoutAnimated(0, 0, 0, clv.AsView.Width, 180dip)
clv.Add(p, cd)
this code trigger the event:
Sub clv_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
So if in my select i read n. records, work, if i have in my select one result ( 1 record ) work the first time, but if i repeat a select that give me again 1 record the event no Trigger.
i think that the problem is inside CustomListView here:
B4X:
Private Sub UpdateVisibleRange
If MonitorVisibleRange = False Then Return
Dim first As Int = getFirstVisibleIndex
Dim last As Int = getLastVisibleIndex
If first <> FirstVisibleIndex Or last <> LastVisibleIndex Then
FirstVisibleIndex = first
LastVisibleIndex = last
CallSubDelayed3(CallBack, EventName & "_VisibleRangeChanged", FirstVisibleIndex, LastVisibleIndex)
End If
End Sub
Why this line:
If first <> FirstVisibleIndex Or last <> LastVisibleIndex Then....
Thank you