Android Question Checkbox in a xCLV panel

mscientist33

Active Member
Licensed User
I have a xCustomListView with a Label and a checkbox. How do I get the checbox clicked or not clicked from within each individual listview item? or get access to any other item inside the panel of each listviewitem? No matter which checkbox I click it always gives me the information for the last checkbox created for the panel inside the xCustomListView.
 

mscientist33

Active Member
Licensed User
This does give me the information that I need but it is only when the xCLV item is clicked not when the actual checkbox is clicked. When I do click the xCLV item I do get this error:

Unexpected event (missing RaiseSynchronousEvents): fav_checkedchange

but I DO have a sub called fav_checkedchage and it does seem to fire (I inserted a toastmessage) but that sub always has to do with the last checkbox created for the xCLV.
 
Last edited:
Upvote 0

mscientist33

Active Member
Licensed User
Thanks @William Lancee , you got me headed in the right direction.

I changed code in my fav_checkedchange to read:

B4X:
Dim ItemIndex As Int = Verses.GetItemFromView(Sender)
    
Dim p As B4XView = Verses.GetPanel(ItemIndex)
    ToastMessageShow(p.GetView(2).Tag,False)
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
@mscientist33 said: only when the xCLV item is clicked not when the actual checkbox is clicked

Just to be clear, the code I posted responds to clicking anything in the item, including the checkbox. The checkbox event itself is not used (eventname = "").
This is often how checkboxes work, they respond to clicking on the label as well as on the box.

I guess the text in your list item is more than just a label. Glad you found a solution.
 
Upvote 0
Top