Wednesday, 10 August 2016

qgis - Relation Reference to simulate filtered drop-down lists


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.



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.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...