Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
B4XPages.SetTitle(Me, "B4XRadioButton Example")
For i = 0 To 5
CLV.Add(CreateItem (i), i)
Next
End Sub
Sub CreateItem (Index As Int) As B4XView
Dim P As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, CLV.AsView.Width, 160dip)
p.LoadLayout("Item")
B4XRadioButton3.Tag = Index ' <-- I need to assign value to Tag
Label1.Text = "Item " & (Index + 1)
Return P
End Sub
Private Sub B4XRadioButton3_Checked
Dim rb As B4XRadioButton = Sender
For Each v As B4XView In CLV.AsView.GetAllViewsRecursive
If v.Tag Is B4XRadioButton Then
Dim s As B4XRadioButton = v.Tag
Log("s.Tag=" & s.Tag & " | rb.Tag=" & rb.Tag)
If s.Tag <> rb.Tag Then
s.Checked = False
End If
End If
Next
Log(rb.Tag)
End Sub