Hello,
today I started experimenting with what appears to be a great framework.
I'm having a problem with image click event.
I set up a "row" to contain a few images. My goal is to react to a click on each image not writing as many subs as there are images. So I tried:
First problem is that i can't see any Caption on top (or bottom) of my images.
Secondly (and more important), looking at the Log I see event "eventname=myimg1_clicked" and "eventname=myimg2_clicked" when clicking on the images so the common sub is never called.
I tried an empty string on each image ID, that called the common myimg_clicked sub but ended up in Exception "signature doesn't match".
So, please, can you show me how am I supposed to program the above simple scenario? Thank you.
BTW, where do we find all the events associated to a control?
udg
today I started experimenting with what appears to be a great framework.
I'm having a problem with image click event.
I set up a "row" to contain a few images. My goal is to react to a click on each image not writing as many subs as there are images. So I tried:
B4X:
....
Dim img As ABMImage
img.Initialize(page,"1","../images/370.png",1.0)
img.Caption="Num.1"
img.Tag=1
img.IsResponsive=True
page.Cell(5,1).AddArrayComponent(img,"myimg")
Dim img2 As ABMImage
img2.Initialize(page,"2","../images/515.png",1.0)
img2.Caption="Num.2"
img2.Tag=2
img2.IsResponsive=True
page.Cell(5,2).AddArrayComponent(img2,"myimg")
....
Sub myimg_clicked(Target As String)
Dim img As ABMImage = page.Component(Target)
Dim title As String = img.Caption
page.ShowToast("toast1", "toastgreen", "Clicked " & title, 5000)
End Sub
Secondly (and more important), looking at the Log I see event "eventname=myimg1_clicked" and "eventname=myimg2_clicked" when clicking on the images so the common sub is never called.
I tried an empty string on each image ID, that called the common myimg_clicked sub but ended up in Exception "signature doesn't match".
So, please, can you show me how am I supposed to program the above simple scenario? Thank you.
BTW, where do we find all the events associated to a control?
udg