Hello,
no way to make it working:
my code:
data are from sql db
Tell me if you need a complete example
Thank you
no way to make it working:
my code:
B4X:
Type dtransazione (panel As String, imgg As String ,txtDescrizione As String, txtconto As String, txtData As String, txtcategoria As String, txtbeneficiario As String, txtprice As String)
data are from sql db
B4X:
If result.RowCount > 0 Then
Do While result.NextRow
Dim CardItem As dtransazione
CardItem.txtData = DateTime.Date(result.GetString("movData"))
CardItem.txtconto = result.GetString("movConto")
CardItem.txtcategoria = result.GetString("movCategoria")
CardItem.txtDescrizione = result.GetString("movDescrizione")
CardItem.txtbeneficiario = result.GetString("movPersona")
CardItem.txtprice = result.GetString("movImporto")
If CardItem.txtprice >= 0 Then
img = "increaseappicon.png"
Else
img = "moneydownicon.png"
End If
CardItem.imgg = img
Dim p As B4XView = xui.CreatePanel("") ' Crea un pannello principale
p.SetLayoutAnimated(0, 0, 0, CvlMovTot.AsView.Width, 145dip)
CvlMovTot.Add(p,CardItem) ORIGINAL WORKING
CvlMovTot.Add(createitem446(CardItem),Swipe.CreateItemValue(CardItem, Array("close operation")))
Loop
Else
CvlMovTot.AddTextItem("No Transactions yet",0)
Log($"Nessun elemento nella tabella $tableName"$)
End If
result.Close
B4X:
Private Sub CvlMovTot_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
Dim ExtraSize As Int = 25 'List size
For i = Max(0, FirstIndex - ExtraSize) To Min(LastIndex + ExtraSize, CvlMovTot.Size - 1)
Dim Pnl As B4XView = CvlMovTot.GetPanel(i)
If i > FirstIndex - ExtraSize And i < LastIndex + ExtraSize Then
If Pnl.NumberOfViews = 0 Then 'Add each item/layout to the list/main layout
Dim tdettagli As dtransazione = CvlMovTot.GetValue(i) <--[U]HERE CRASH java.lang.RuntimeException: Field: txtDescrizione not found in: android.finanze.sql.clvswipe$_swipeitem[/U]
Pnl.LoadLayout("clvMovTot")
lblName.Text = tdettagli.txtDescrizione
lblImporto.Text = tdettagli.txtprice & " €"
lblData.Text = tdettagli.txtData
lblTipo.Text = tdettagli.txtcategoria
lblconto.Text = tdettagli.txtconto
lblPerson.Text = tdettagli.txtbeneficiario
AjustaImageView(imgMov,tdettagli.imgg)
If tdettagli.txtcategoria <> "Generale" Then
lblPerson.Visible = True
Else
lblPerson.Visible = False
lblImporto.Left = 40%x
End If
End If
Else 'Not visible
If Pnl.NumberOfViews > 0 Then
Pnl.RemoveAllViews 'Remove none visable item/layouts from the list/main layout
End If
End If
Next
End Sub
Tell me if you need a complete example
Thank you