SelectionIndex in filtered List


#1

This topic also has been discussed for app Inventor in the google community but there was no solution.
No, since I’m working with appybuilder gold, the problem still persists.
Whe I use a listpicker with the search filter, the reult of a selected item is wrong. It always show the index of the filtered list not the one frome the origanal.
Example:
List content: a,b,c,d,e => not filtered c is index 3
List content filtered only c: => filtered c is index 1


#2

We’ll inspecting selection text instead of selection index help?


#3

Perhaps? Where can I try it out?


#4

You can use listpicker.selection


#5

I think that is not a problem, but the right way to do it. When you filter a list, then you have a different list, and it returns the right index number for that list, right?

What you can do is to have the original list in a global variable, and when the user selects something, use the “index in list” block to find the index of the item selected IN THE ORIGINAL LIST saved in the global, instead of using the index of the filtered list. No big deal really.


#6

I ran into this as well, and would up using the selection text solution, but the fact that a filtered list is a new list with new selection indexes is non-intuitive and should probably be highlighted. I’m trying to understand how to implement the selection, but I’m not able to visualize how this would actually be implemented?


#7

Because there is only 3 options to filter in Sheets


There is no substitute for getting AT IS IT in sheet


#8

Sheets? I’m not using it.


#9

this bug is already around for more than 3 years…
see also https://groups.google.com/d/msg/programming-with-app-inventor/v483nNLN51M/Q8ZLbntYT_IJ

currently you have to ignore the selection index if you use a filter in a listpicker or listview
as @Italo already said as workaround you can use the listview selection together with the index in list block, but this works only, if there are no duplicates in the list…

I’m trying to understand how to implement the selection, but I’m not able to visualize how this would actually be implemented?

you might want to try something and if you get stuck, post a screenshot of your relevant blocks…

btw. my jQuery Mobile workaround gives you the correct selection index back after filtering the list http://puravidaapps.com/listview.php
Taifun