Bug report #10649

the edit widgets do not work as expected

Added by Salvatore Larosa over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Edit widget
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:19048

Description

I tested some edit widgets like Hidden or Value Map and they are not working in current master.
If you open the sample project attached with 2.2 everything is fine.

demo.zip (187 KB) Salvatore Larosa, 2014-06-19 03:03 PM

vmap_22.png (16.2 KB) Salvatore Larosa, 2014-06-20 12:39 AM

Associated revisions

Revision 8b898b96
Added by Matthias Kuhn over 10 years ago

Forms: Hide "Hidden" widgets
Partly fixes #10649

History

#1 Updated by Salvatore Larosa over 10 years ago

  • File deleted (demo.zip)

#2 Updated by Salvatore Larosa over 10 years ago

#3 Updated by Matthias Kuhn over 10 years ago

The hidden fields could be improved indeed (title needs to be removed for autogenerated forms)

What's wrong with the value map?

#4 Updated by Matthias Kuhn over 10 years ago

  • Status changed from Open to Closed

Partially fixed in changeset 8b898b9645967a306b84b7f72ee5e5a9d1cf111e.

#5 Updated by Salvatore Larosa over 10 years ago

Hi Matthias, why it was closed?
Just compiled and the issue is still there :-(

Can you hide fields? is it working for you?

What's wrong with the value map?

The value map in 2.2 shows descriptions for the values (see image)
either in the attribute table or identify result:

#6 Updated by Matthias Kuhn over 10 years ago

Hi Salvatore, I was not aware that you were talking about the attribute table, from the context I thought you were talking about forms.

Anyway, it should be fixed with the last commits

#7 Updated by Salvatore Larosa over 10 years ago

  • Resolution set to fixed/implemented

Thanks Matthias!

#8 Updated by Giovanni Manghi over 10 years ago

Salvatore Larosa wrote:

Thanks Matthias!

May be I can clarify what is going on with the Value Map.

in past QGIS releases the value map worked like many expected: the user choose by using the description and QGIS wrote the value in the table.

at some point the Value Map started to work in a different way: the user choose by the description and QGIS still wrote the value, but when opening the table in QGIS, the program always shows the description (just because the widget was active, if opening the table with another software the column was filled with the values from the map).

we had a long discussion with Jurgen, and of course he won :)

#9 Updated by Paolo Cavallini over 10 years ago

Agreed, the previous behaviour made more sense to me.

#10 Updated by Matthias Kuhn over 10 years ago

What's the "previous behaviour"?

I think the way it works with the latest patches is the one that jef was in favour of and which I also think is the right way.

#11 Updated by Giovanni Manghi over 10 years ago

Matthias Kuhn wrote:

What's the "previous behaviour"?

the map has two columns, description and value.

The user chooses by the description and qgis write (and shows) the value.

Now it is (was?): the user chooses by the description and QGIS still writes the value, but shows the description.

#12 Updated by Paolo Cavallini over 10 years ago

IMHO description and value should be two different field, with two different contents. The user should select the description, and the field should be filled with the value.
E.g.:
  • the user selects the common name for an animal species, and the scientific name goes to the table
  • the user selects the descriptive name for a type of road, etc, and the corresponding code goes to the table

#13 Updated by Giovanni Manghi over 10 years ago

  • the user selects the common name for an animal species, and the scientific name goes to the table
  • the user selects the descriptive name for a type of road, etc, and the corresponding code goes to the table

this is what always happens (before and after). The "Only" difference is that in latest qgis releases if the widget is active then in the table it always shows the animal specie/road name, when actually in the table is written the scientific name/road code.

#14 Updated by Matthias Kuhn over 10 years ago

Paolo, if I understand correctly, that's the way it works since about three hours (latest patches). I simply forgot about it before, Value Relation already worked that way.

In the QGIS UI always the description is shown. The value is only used for the backend.

#15 Updated by Paolo Cavallini over 10 years ago

Confirmed, thanks.

Also available in: Atom PDF