Android Question B4XSearchTemplate Value

advansis

Active Member
Licensed User
Longtime User
Hi guys, anyone knows how to set and get the "value" of the listview in B4XSearchTemplate ?
I need to display/search a string value and "lookup" another value.

In the standard way, I populate the list as:

B4X:
Dim src As B4XSearchTemplate
Dim L As List
L.Initialize
L.add("First item")
L.add("Second item")
L.add("Third item")
src.SetItems(L)

I would like to do something like:

B4X:
Dim src As B4XSearchTemplate
Dim M As Map
M.Initialize
M.put(1,"First item")
M.put(3,"Second item")
M.put(7,"Third item")
src.SetItems(M)

So that, when I choose one item I can have "1" or "3" or "7" [...] instead of "First item" or "Second item" [...]

I tried using, but without luck:
srcCustomListView1.AddTextItem
src.CustomListView1.GetValue([...])

Thanks in advance
 

advansis

Active Member
Licensed User
Longtime User
Thanks Erel.
Is there a way to retrieve the B4XOrderedMap from the B4XSearchTemplate?
I mean, data population is done in another module (business layer) and I prefer not to create a global variable, if possible.
In such cases, I usually use the Tag property to carry my Map, but B4XSearchTemplate doesn't have one.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…