B4J Question Combox Not Refresh

Firpas

Active Member
Licensed User
Longtime User
I'm trying b4j combobox and i've found a Little problem.
Ithis is my code to fill the combobox.ítems list

B4X:
Sub DevicesFill
    Dim Img As Image
    Img.Initialize(File.DirAssets, "device.png")
 
    For i=0 To 5
        Dim Pnl As Pane
        Pnl.Initialize("ItemDev")
        Pnl.SetSize(CboDevices.Width, CboDevices.Height)
     
        Dim Icon As ImageView
        Icon.Initialize("ItemDev")
        Pnl.AddNode(Icon, 5, 5, Pnl.Height-10, Pnl.Height-10)
        Icon.SetImage(Img)
     
        Dim Lbl1 As Label
        Lbl1.Initialize("ItemDev")
        Pnl.AddNode(Lbl1, 80, 5, Pnl.Width - 80, 20)
        Lbl1.Text = "Device " & i
        Lbl1.TextColor = fx.Colors.From32Bit(0xFF000000)
     
        Dim Lbl2 As Label
        Lbl2.Initialize("ItemDev")
        Pnl.AddNode(Lbl2, 80, 30, Pnl.Width - 80, 20)
        Lbl2.Text = "936993322" & i
        Lbl2.TextColor = fx.Colors.From32Bit(0xFF7F7F7F)
     
        CboDevices.Items.Add(Pnl)
    Next
 
End Sub

When i click on checkbox firstime it look well, but selecting other ítem and clicking again, the ítems that has been selected aren´t visibles.

Is necesary to rfresh the ítems list??

How?

Attached you can find some screen shot.

Thanks in advance
 

Attachments

  • image1.png
    51.5 KB · Views: 426
  • image2.png
    49.3 KB · Views: 392

Daestrum

Expert
Licensed User
Longtime User
This was in the combobox api notes
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Could you not use a listview instead?
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
You can use my class called "custom combobox" which was initially designed to bypass this problem. See in my signature. You can modify it to support 2 lines of text.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…