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

What happens if two controls are connected to the one field on the form #571

Closed MikhanGusev closed 7 years ago

MikhanGusev commented 7 years ago

Original message:

Actually what happens in mobile app is this. If I skip Combo1 and I put a value in Combo2, Combo1 is not valorized but the app accepts saving and next time if I show vector info both combos are valorized. If I put a value in Combo1 and skip Combo2 then I save, the app gives message 'value is not from list' and saves, but when I show vector info there is no value in linked layer's field, and both combos are not valorized.

For me in all cases the value from the second (the last) combo was saved, which seems logical. There was no message 'value is not from list'. The proposal is to handle such situations so the user can select the value from the one combo and deselect from another.

plinioconti commented 7 years ago

Hi, please see the the test case in issue #570

Use the same CSV, FORM, and the same two comboboxes ("NOME SCIENTIFICO" and "NOME COMUNE")

MikhanGusev commented 7 years ago

Yes, I reproduced the case with this form. I think this is not a bug but some behavior. @4eRTuk what we can do with this? How we can handle the case when two controls on the form are assigned to the one field? It is important for users to have this feature e.g. for plants data collecting.

4eRTuk commented 7 years ago

I think we should not allow this.

plinioconti commented 7 years ago

Just think to the case you want to select an item in list using sometimes the key (ex. product code), sometimes the displayed value (ex. Product name).

It is not so unusual!

4eRTuk commented 7 years ago

You could use alias like "Code (name)" and keep value as is.

plinioconti commented 7 years ago

yes. that is a workaround, but not always so good.

What if the list is long? maybe you would sort "key" and "displayed" in two different lists (combobox) to easy find the item.

Or think in my case, I have "key" and "displayed" are both text values, they are not short. They are both plant names (botanic and common name). It's hard to have both texts in the same line on a mobile device!

simgislab commented 7 years ago

After another round of discussions, there are two options: OPTION 1 - easier for us, potentially more inconvenient for you (?) Combine two lists into one combobox. We can add a tool to facilitate such loading.

Then search will work as usual and no changes on mobile will be needed at all.

OPTION 2 - more work

  1. Formbuilder changes We're introducing the new control - Double combobox (tentative name). Places two comboboxes and two labels for them. Set the following parameters:

Related ticket: https://github.com/nextgis/formbuilder/issues/110

  1. Mobile changes If mobile sees such control, then when something is selected in on in the field1 will lead to appropriate selection in the field 2 and vice versa. But if something NEW is entered in one the fields and 'allow adding values' was ON, then it is added like usual and automatically transfered to another combobox as well.

So you can't choose two values with different inners at all.

plinioconti commented 7 years ago

Yes, it sounds good, but I am not sure I understand. Can I see / test it?

simgislab commented 7 years ago

We need to choose one way or another, before starting to implement it. So there is nothing to try yet.

First one is simply the way to combine Latin and Local names in one column, so you'll be able to type/select any. No need to have two fields.

Second one is more work, we'll need to add a special control for that.

plinioconti commented 7 years ago

It would be great to have two different fields, if possibile.

Il 13 lug 2017 8:45 PM, "Maxim Dubinin" notifications@github.com ha scritto:

We need to choose one way or another, before starting to implement it. So there is nothing to try yet.

First one is simply the way to combine Latin and Local names in one column, so you'll be able to type/select any. No need to have two fields.

Second one is more work, we'll need to add a special control for that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextgis/android_gisapp/issues/571#issuecomment-315167404, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab6D6vqDUBtLJD5qwrUOLA_3aJ-uGgT7ks5sNmW2gaJpZM4Nykif .