https://issues.qgis.org/https://issues.qgis.org/favicon.ico2019-04-10T15:05:53ZQGIS Issue TrackingQGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1038512019-04-10T15:05:53ZGiovanni Manghigiovanni.manghi@gmail.com
<ul><li><strong>Category</strong> changed from <i>Forms</i> to <i>Edit widget</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>You sure? in the context of the <strong>QGIS PROJECT</strong> where the widget is set it always shows the description. You must check by opening the data source in a different/blank project.</p> QGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1039132019-04-11T06:32:02ZRobin Rotsaertrobin.rotsaert@limburgs-landschap.be
<ul><li><strong>File</strong> <a href="/attachments/download/14777/qgis_test_valuemapwidget.jpg">qgis_test_valuemapwidget.jpg</a> added</li></ul><p>I checked again in a blank project and still have the same problem. See attached screenshot. I created a multi-polygon layer in a geopackage and set up the value map widget as shown in the screenshot. Then I created 3 features and assigned a value from the drop-down to each of them. As seen in the screenshot, not the value but the description is saved to the attribute table.</p>
<p>ps: this test was done in QGIS 3.6.1</p> QGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1039142019-04-11T07:01:06ZAlessandro Pasotti
<ul></ul><p>Did you check what is actually saved into the database?</p>
<p>Because in the attribute table you won't see the actual value but the mapped one.</p> QGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1039182019-04-11T08:24:37ZRobin Rotsaertrobin.rotsaert@limburgs-landschap.be
<ul></ul><p>Just checked. In the database the values are saved correct!</p>
<p>So I guess I totally misunderstood the concept of this values-description thing. It wasn't clear for me the values are saved on the level of the database in stead of in the attribute table. I thought its practicality was in giving people the choice of editing by writing down the value (if they know them by heart) or by using the more readable descriptions in the drop-down. But probably it's meant as a means to make bigger databases more lean?</p>
<p>Maybe the misunderstanding occurred to me because when selecting 'Value Map' as a widget type it says underneath the box "Combo box with predefined items. Value is stored in the attribute, description is shown in the combo box" (see screen shot). By saying it is stored in the attribute, I expected it to be shown in the attribute table.<br />I guess I won't be the only one misunderstanding this, so maybe this should be rephrased and get some extra attention in the user guide? suggestion "Combo box with predefined items. Value is stored in the underlying database, description is shown in the combo box in both the form and the attribute table".</p>
<p>Thanks anyway for the quick responses.</p> QGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1039212019-04-11T08:52:05ZAlessandro Pasotti
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Rejected</i></li><li><strong>Resolution</strong> set to <i>invalid</i></li></ul><p>Robin Rotsaert wrote:</p>
<blockquote>
<p>Just checked. In the database the values are saved correct!</p>
<p>So I guess I totally misunderstood the concept of this values-description thing. It wasn't clear for me the values are saved on the level of the database in stead of in the attribute table. I thought its practicality was in giving people the choice of editing by writing down the value (if they know them by heart) or by using the more readable descriptions in the drop-down. But probably it's meant as a means to make bigger databases more lean?</p>
<p>Maybe the misunderstanding occurred to me because when selecting 'Value Map' as a widget type it says underneath the box "Combo box with predefined items. Value is stored in the attribute, description is shown in the combo box" (see screen shot). By saying it is stored in the attribute, I expected it to be shown in the attribute table.</p>
</blockquote>
<p>That was the wrong assumption: the values shown in the attribute table are generated by the widget formatters (this is valid for all widgets).</p>
<blockquote>
<p>I guess I won't be the only one misunderstanding this, so maybe this should be rephrased and get some extra attention in the user guide? suggestion "Combo box with predefined items. Value is stored in the underlying database, description is shown in the combo box in both the form and the attribute table".</p>
</blockquote>
<p>I would say no: first of all there might be no database if the storage is say a WFS or a shapefile, second, I think "attribute" (without "table") is more appropriate, but I'm not a native english speaker so I might be wrong.</p>
<p>But yes please, make a PR with your proposals for a better wording and feel free to make a PR on the manual to make it clearer.</p>
<blockquote>
<p>Thanks anyway for the quick responses.</p>
</blockquote>
<p>You're welcome!</p> QGIS Application - Bug report #21824: value map widget saves description in stead of value to attribute tablehttps://issues.qgis.org/issues/21824?journal_id=1039222019-04-11T09:27:03ZRobin Rotsaertrobin.rotsaert@limburgs-landschap.be
<ul></ul><p>I think the *.dbf-file of a shapefile can be seen as its underlying database even though it's only one table. As for WFS, I can be wrong, but most times these are not set up to be editable, so setting up a value map widget for these would be like setting up a translation tool to make the given field more readable.</p>
<p>So I think it's better I make those PR's like you suggest.</p>