Thanks @Andrew (Digitwell)
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.
Hello All After thinking about it yesterday and having a quick chat with Erel, I decided that my previous long list examples were not basic enough for newer B4X developers, so I put together a minimal xCLV with LL code example together with comments in the code module. There are no themes...
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.
@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.
Thank you all for your attention to my problem
Maybe I couldn't explain the problem, so I upload a piece of code for you, maybe one of you can help me and all of you are able to that.
my code too primitive.
"Code smells" are common patterns that can indicate that there is a problem in the code. A problem doesn't mean that the code doesn't work, it might be that it will be difficult to maintain it or that there are more elegant ways to implement the same thing. Remember that not everything is clear...
www.b4x.com
For example,
B4X:
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
could become a function which takes a parameter and returns an image data
B4X:
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
then getDT can be
B4X:
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
which is much easier to maintain
EDIT: Fixed bugs in example code above - copy/paste error (download file is correct)