nextgis / android_gisapp

:dart: GIS application for Android
http://nextgis.com/nextgis-mobile
GNU General Public License v3.0
129 stars 107 forks source link

Incorrect sorting of the combobox values #570

Closed MikhanGusev closed 7 years ago

MikhanGusev commented 7 years ago

Original message:

I loaded a list of alphabetically sorted values from a .csv file using form builder. When I actually use the combobox to add a featured vector in mobile app, the values listed are not sorted anymore. This is a big issue for me, I make you an example. This is a garden. I need to write the right botanical name of the tree. I see in front of me the plant I see that it is a "Prunus" species but I don't remember how to spell the complete name. So I would like to scroll down to the "P" and see "Prunus Avium, Prunus Cerasus, Prunus Persica, etc..." or even better to start typing "Prun" and see the same sorted list of Prunus species. Is there a way to load the values preserving the sorting?

But for me all works correctly. I load the following .csv via Formbuilder (not sorted, but in the specific order), save to ngfp and after sending all items displayed in the same order on a mobile device. It also works if I change inner and outer value in this .csv.

"id";"transport" 11;"Трамвай" 12;"Троллейбус" 13;"Автобус городской" 16;"Автобус пригородный" 17;"Такси" 18;"Пригородный поезд" 19;"Метрополитен"

The proposal is to implement the real sorting on the Formbuilder side and to retain the order of elements on the mobile side (if this is an actual bug).

plinioconti commented 7 years ago

Hi guys,

here you have a sample case to reproduce the problem. I attach NGFP file and CSV file.

It is about plants. I'm sorry it is dirty with a lot of fields you don't mind ,I'm expeimenting with NextGIS :) Just look at these two fields: "NOME SCIENTIFICO" (it is the botanical latin name of the plant) "NOME COMUNE" (it is the common plant name in italian. note I transalted to italian just a few plant names, as you see in the CSV file, for the others you have NOME COMUNE = NOME SCIENTIFICO)

In the form you have two comboboxes:

"Nome Scientifico" takes values from coloumn 1 and 2 of the CSV (identical values key and displayed) "Nome Comune" takes values from column 1 and 3 of the CSV

I hope it i not hard to understand and reproduce. In case you need help just tell me!

cheers, Plinio form11.zip ListaPiante.zip

MikhanGusev commented 7 years ago

Hi, Plinio. As I see, none of the three columns in the attached CSV are sorted. The Formbuilder app retains the order of the elements just as they were loaded. But I also see that even this order of elements is changed in the mobile app. I think it is a bug which occurs when you set the option "Input with search" for the combo to ON. Don't forget that with the "Input with search" option ON for combo you still have an opportunity to start typing the name of the plant and to see the available names for it. It works.

plinioconti commented 7 years ago

Correct! it looks The list order is messed up by the mobile app not by the form builder.

It would be great if you can fix this... In my list a have plant botanix names. Often they are quite long names, for example:

1 Prunus domestica Damaschina estiva 2 Prunus domestica San Giovanni 3 Prunus domestica Coscia di monaca 4...

Actually when I start typing "Prun" the mobile app show me only one of the Prunus and the following item in the displayed list start with other letters, so operator may think that is the only prunus in the list ( this actually happened).

simgislab commented 7 years ago

Ok. The resolution is this, we're going to keep order of values shown when something is entered in the field to match the order of original data. When the flag of 'add own values' is on.

plinioconti commented 7 years ago

Ok, how do I test your fix?

simgislab commented 7 years ago

we'll release new NGM soon!