B4J Question [Solved] How to use the click event on SimpleMediaManager

Mark Read

Well-Known Member
Licensed User
Longtime User
I am having trouble with the click event when using the example 2 from Erel (here). I have only changed where the images are coming from but as in the example, each line contains 4 images and 4 labels. The click event fires as required but I need the label text. I know its probably simple but I cannot see the solution.

B4X:
Private Sub CustomListView1_ItemClick (Index As Int, Value As Object)
    Log("*********************************")
    Log("Image clicked is: " & Index)
    Log("Value: " & Value)
    'Dim pnl As B4XView =Sender
    
End Sub

Many thanks.
Mark
 

Mariano Ismael Castro

Active Member
Licensed User
Hello, since in this case the items is made up of 4 panels, a possible solution (maybe not the best) is to assign the same event name to all four panels and then access the label with the MouseClicked event. I attach the modified example 2
 

Attachments

  • SMM_Example2_Modified.zip
    186.5 KB · Views: 61
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Hello, since in this case the items is made up of 4 panels, a possible solution (maybe not the best) is to assign the same event name to all four panels and then access the label with the MouseClicked event. I attach the modified example 2
Thank you for your time and trouble. That is exactlay what I required. I was looking at the wrong object and its events. Now I see the solution, it is painfully obvious šŸ™ˆ

Regards
Mark
 
Upvote 0
Top