To the list -

Please disregard my first post about this issue. I made an error by simplifying my example. The scenario is as follows:

I have *2* columns in a table - both with a "Value Relation" setup. The second column has furthermore a filter (/current_value('first_column') = "some_column_in_the_lookup_table"/ ) which decides the values in the value list for the second column based on the chosen value in the first column -  a "drill-down" effect.

In QGIS ver. 3.38 and prior versions -  you could change the behavior of the drop-down value list for the second column by checking/unchecking the "Allow NULL value" checkbox:

 * If "Allow NULL value" was checked, the chosen value in the second
   column would be "blank"/not chosen.
 * If "Allow NULL value" was /not /checked, the chosen value in the
   second would automatically be set to the first value in the filtered
   value list.

So you - as a QGIS project designer - could decide if the second column automatically got a value from the drop-down list for the second column when the user chose a value for the first column.

/However,/ in QGIS version 3.40 and onward, this behavior has changed. Regardless of the state of the "Allow NULL value" checkbox, the initial value of the widget for the second column is always "blank"/not chosen (If manually activated, the drop down list for the second column contains the values derived from the filter expression. So the filter function is working)

Is this the new expected behavior or is it a regression bug ? And if it is the expected behavior: Can you somehow enable the old behavior ??

I have many (many, many...) QGIS projects depending on the old behavior.

Use case example: I have 2 columns in a table. The first column contains the Danish name for a tree species. The second column contains the Latin name for the tree species. So the value in the second column is 100% dependent on the user-chosen value in the first column. The user should not be bothered with selecting the Latin name in the second column from a value list with a single item.


Med venlig hilsen / Best regards

Bo Victor Thomsen

On 3/29/2025 10:47 AM, Bo Victor Thomsen wrote:

Hi list -

In QGIS ver. 3.38 and prior versions - using a "Value Relation" widget in a attribute form - you could change the behavior of the drop-down value list in the widget by checking/unchecking the "Allow NULL value" checkbox:

  * If "Allow NULL value" was checked, the chosen value  would be
    "blank"/not chosen.
  * If "Allow NULL value" was /not /checked, the chosen value would be
    set to the first value in the value list.

So you could decide if the field automatically got a value from the drop-down list without any manual user action.

/However,/ in QGIS version 3.40 and onward, this behavior has changed. Regardless of the state of the "Allow NULL value" checkbox the initial value of the widget is always "blank"/not chosen.

Is this the new expected behavior or is it a regression bug ? And if it is the expected behavior: Can you somehow enable the old behavior ??

I have many (many, many...) QGIS projects depending on the old behavior.

 --

Med venlig hilsen / Best regards

Bo Victor Thomsen
_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to