QGIS – Simulating Filtered Drop-Down Lists Using Relation Reference

qgisqgis-2.10widget

I have a layer of Land Uses that has a 3-tiered classification system (basically so that it can be broken down for different uses by other people).

I have managed to create Project Relations and use the Relation Reference widget to achieve the drop-downs in the forms –

Attribute Look-up Table:
enter image description here

Project Relations:
enter image description here

Relation Reference Widget:
test

Attribute Pop-Up:
enter image description here

(1) Is this the correct/intended methodology to achieve filtered drop-downs like this (where one attributes list of available values is dependant on a previous field)? Is just seems more logical to be using the filter in the Value Relation widget, except I can't get it to filter based on another field…!

(2) Is there a simple way in the pop-up to remove the table icon that brings up another form (assuming to add additional 'child' records to my parent feature)?
As that is not what I am doing in this case, it's misleading to users to have it there.

Best Answer

  1. The widget types Value Relation and Relation Reference have a large overlap. Certain functionality - like (chained) filtering which you are using here - is only implemented for one of the two. So yes, this is a valid/reasonable approach.

  2. There is no simple way (yet) but it wouldn't be much effort to hide this button with an option in the widget configuration dialog. You can file a feature request, create a pull request or help improving QGIS by funding somebody to implement this feature.

Related Question