Hi, I'm having a trouble in my project with B4XPlusMinus. I'm using panel as a cell (card) for xcustomlistview. In my panel I'm using B4XPlusMinus for change item quantity.
This is what it looks like,
My problem is I can get specific value from panel (which panel/button I just clicked) by using below code,
Dim index As Int = CLV.GetItemFromView(Sender)
Dim pnl1 As B4XView = CLV.GetPanel(index)
Dim pnl2 As B4XView = pnl1.GetView(0)
'example : Log(pnl2.GetView(6).Text)
But when I use above code for B4XPlusMinus1_ValueChanged (Value As Object) it giving me an error,
java.lang.ClassCastException: b4a.example.b4xplusminus cannot be cast to android.view.View
I want to change B4XPlusMinus value and save that value in SQLite database. I don't know how to get which panel that B4XPlusMinus belongs.
this is the code I've used,
Sub B4XPlusMinus1_ValueChanged (Value As Object)
Dim index As Int = CLV.GetItemFromView(Sender)
Dim pnl1 As B4XView = CLV.GetPanel(index)
Dim pnl2 As B4XView = pnl1.GetView(0)
SQL1.ExecNonQuery($"UPDATE cart(quantity) VALUES (${Value}) WHERE id=${pnl2.GetView(6).Text}"$)
End Sub
And this is the error,
java.lang.ClassCastException: b4a.example.b4xplusminus cannot be cast to android.view.View
I hope you can understand what I'm saying. Sorry about my English language. If anyone know how to fix this, Please let me know.
Thank you