merlin2049er Well-Known Member Licensed User Longtime User Dec 11, 2013 #1 I filled a listview with a query, and put the url (of that query) in that listview tag property (to remain hidden). How do I access that tag when someone clicks on a item in listview? What I did was ignore that tag, and run another query based on the index of that listview (which was assigned the table index) when that listview item was clicked. I'm wondering if there is a shortcut.
I filled a listview with a query, and put the url (of that query) in that listview tag property (to remain hidden). How do I access that tag when someone clicks on a item in listview? What I did was ignore that tag, and run another query based on the index of that listview (which was assigned the table index) when that listview item was clicked. I'm wondering if there is a shortcut.
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2013 #2 Are you handling multiple ListViews with the same event sub? Upvote 0
merlin2049er Well-Known Member Licensed User Longtime User Dec 11, 2013 #3 no, just 1 listview in this case. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2013 #4 So why not use: YourListView.Tag ? Upvote 0
merlin2049er Well-Known Member Licensed User Longtime User Dec 11, 2013 #5 ok, I thought i tried that or something like that. I think it was pulling up the same url. Upvote 0
merlin2049er Well-Known Member Licensed User Longtime User Dec 11, 2013 #6 NJDude says listviews have one tag per listview (not per item)... That's why I was returning with the same url. Upvote 0
NJDude says listviews have one tag per listview (not per item)... That's why I was returning with the same url.
stevel05 Expert Licensed User Longtime User Dec 11, 2013 #7 You could use AddSingleLine2 (or twolines or twolines and bitmap) and specify the URL as the data to be returned) Upvote 0
You could use AddSingleLine2 (or twolines or twolines and bitmap) and specify the URL as the data to be returned)
mangojack Expert Licensed User Longtime User Dec 11, 2013 #8 merlin maybe have a re-read of the answers regarding this in a previous thread of yours ... ListView Values / Queries ... If I am correct your are using AddTwoLinesAndBitmap2 to assign the Records ID to the final parameter/argument of this method so when a person clicks on this item your get the ID returned as the Click_Event value. You then use the ID to run a Query to retrieve further data / or just the URL ?? of that recordset. If the only reason you run a Query after list click is to get the URL then why not put the URL as the return value instead of the ID , so when the list is clicked you have instant access to the URL. Code: Copy Sub ListView_ItemClick (Position As Int, Value As Object) dim recordURL as String = Value End Sub I have not tested but think its right .. Cheers mj Upvote 0
merlin maybe have a re-read of the answers regarding this in a previous thread of yours ... ListView Values / Queries ... If I am correct your are using AddTwoLinesAndBitmap2 to assign the Records ID to the final parameter/argument of this method so when a person clicks on this item your get the ID returned as the Click_Event value. You then use the ID to run a Query to retrieve further data / or just the URL ?? of that recordset. If the only reason you run a Query after list click is to get the URL then why not put the URL as the return value instead of the ID , so when the list is clicked you have instant access to the URL. Code: Copy Sub ListView_ItemClick (Position As Int, Value As Object) dim recordURL as String = Value End Sub I have not tested but think its right .. Cheers mj