B4J Question Button Plus Minus in CustomListView

qey

Member
Hi. I would like to make a function where the item is in customlistview and inside have a plus and minus button same like Add To Cart function. So in b4a we can set using panel.GetView. but for B4j is using Pane , is it the same ? Attach here is the example of B4A code.
B4X:
Dim Index As Int = CustomListViewCart.GetItemFromView(Sender)
        Dim Product_ID As String = CustomListViewCart.GetValue(Index)
        Dim mPanel As Panel =     CustomListViewCart.GetPanel(Index)
        Dim rPanel As Panel =     mPanel.GetView(0)
        lblPrice =  rPanel.GetView(5)
        txtQte = rPanel.GetView(6)
        lblTotal = rPanel.GetView(4)
       
        lblProductTax = rPanel.GetView(9)
        lblProductID = rPanel.GetView(8)
        lblToppingPrice = rPanel.GetView(10)
       
        If txtQte.Text >= 1 Then
            txtQte.Text =  NumberFormat((txtQte.Text - 1),0,0)
            lblTotal.Text = ((lblPrice.Text * txtQte.Text)+ lblToppingPrice.Text.Trim),2)
        End If
 

qey

Member
I change getView to getNode but still got error. This is my view tree and attached with B4J code.
B4X:
Dim Index As Int = clvAddon.GetItemFromView(Sender)
    Dim id As String = clvAddon.GetValue(Index)
    Dim pnl As Pane =     clvAddon.GetPanel(Index)
    Dim rpnl As Pane = pnl.GetNode(0)
    lblAddonPrice1 =  rpnl.GetNode(7)
    lblAddonQty1 = rpnl.GetNode(6)

    lblAddonQty1.Text = 0
    If lblAddonQty1.Text >= 0 Then
        lblAddonQty1.Text = lblAddonQty1.Text + 1
        lblTotal.Text = Main.cLibs.Truncate(lblAddonPrice1.Text * lblAddonQty1.Text,2)
    End If
Screenshot 2022-01-27 150756.png
 
Upvote 0
Top