img.tag = lbl
private img as b4xview = sender
if (img.tag is label) then
log("text of label is "&img.tag.as(label).text)
end if
the image you uploaded is too small for me to see clearly, however,
you can assign the label to the tag of the image on creation (after load layout)
B4X:img.tag = lbl
then in the click event
B4X:private img as b4xview = sender if (img.tag is label) then log("text of label is "&img.tag.as(label).text) end if
@Andrew (Digitwell) 's solution works well if applied correctly. But, your explanation of your problem is not good. If you cannot express it well in English, your best bet is to upload your project or at least a clear copy of you designer item layout tree and the items layout where you will not need binoculars to see it. With your cooperation, your issue can be solved.I changed an image.
I used your code but not work.
In items layout 3 panel every panel image & label .
If user clicked on image i want read value from label in panel.
@Andrew (Digitwell) 's solution works well if applied correctly. But, your explanation of your problem is not good. If you cannot express it well in English, your best bet is to upload your project or at least a clear copy of you designer item layout tree and the items layout where you will not need binoculars to see it. With your cooperation, your issue can be solved.
Also, take a look at @Peter Simpson 's project. It helped me a lot, way back when I needed a push.
m = MyList.Get(i+2)
Dim link1 As String=URL &"ad1/image/pic/"& m.Get("folder")&"/"&m.Get("image")
Dim id As Int=m.Get("id")
Dim j As HttpJob
j.Initialize("", Me)
j.Download(link1)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
id3 = CreateItem(link1,id,j.GetBitmap)
End If
private sub getimageandcreateitem(idx as int) as resumeablesub
private m as map
m = MyList.Get(id)
Dim link1 As String=URL &"ad1/image/pic/"& m.Get("folder")&"/"&m.Get("image")
Dim id As Int=m.Get("id")
Dim j As HttpJob
j.Initialize("", Me)
j.Download(link1)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
return CreateItem(link1,id,j.GetBitmap)
else
return null
End If
end sub
For i = 0 To MyList.Size-1 Step 3
Log(i)
wait for (getimageandcreateitem(i)) complete (r As ImageData)
id1 = r
If (i+1) <MyList.Size Then
wait for (getimageandcreateitem(i+1)) complete (r As ImageData)
id2 = r
Else
' id2.title = DIG: Bug here
id2 = CreateItem("","",Null)
End If
If (i+2) <MyList.Size Then
wait for (getimageandcreateitem(i+2)) complete (r As ImageData)
id3 = r
Else
'id3.Title = DIG: Bug Here
id3 = CreateItem("","",Null)
End If