0

I have an attributes form with two dependent dropdown objects - let's call them categ_field and subcateg_field. Each of them refers to the corresponding field of my geodataset: categ_field and subcateg_field. A lookup table with the fields categ_lut and subcateg_lut is used to define valid combinations of category and subcategory values.

Once a category entry is done in the categ_field-dropdown the subcateg_field-dropdown offers the set of valid values according to the selected category. That works pretty fine as long as I add or change just a single dataset/record.

(The filter expression of the subcategory dropdown is "categ_lut" = current_value('categ_field'))

As soon as I select more than one record in my attribute table and change to "multi edit mode" things get out of control - my scenario is: I want to change the category and the sub-category values for about 100 records without having to manually edit each of the records.

In multi edit mode I can see the appropriate dropdown list-values for the categ_field. After selecting one of these values the following message is returned "Unsaved multiediting changes: Apply changes or reset changes". Choosing "apply changes" returns the message: "Attribute changes for multiple features are applied" - and the value is set for each of the selected 100 records.

Subsequently, I would expect an automatic update of the subcateg_field-dropdown values according to the changed value of the categ_field. But nothing at all happens - the subcateg_field-dropdown keeps displaying the original instead of the updated set of selectable values.

Since I have implemented a validity check in the underlying database (PostgreSQL) I get an error when trying to save edits and thus have to undo the whole process.

That means: multi edit seems not to work in the way I have implemented my cascading dropdowns ... a related problem was posted here a couple of years ago: Update "value relation" field problem in QGIS multi-edit mode but there was no appropriate solution then ....

Any ideas?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.