-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editable option for combo box in value relation editor cannot be used #14618
Comments
Author Name: Giovanni Manghi (@gioman) Can you please explain better the issue?
|
Author Name: Denis Rouzaud (@3nids) I'll try. So, for a layer you can use your own edit form by setting a file path in the layer properties dialog, under "general" tab, "Edit UI". Suppose, you have a field's edit widget defined as "value relation" under the fields tab. Then, you will draw a combo box for this field in QtDesigner. Suppose then, that the related table is very long. For example, you chan chosse within a few hundreds of material types for a pipe. Having the colum material in table pipe related to id in table material. I found a good idea to use the "editable" option in Qt to let the user type the first characters to restrict the choices within the combo box. But, doing so (i.e. having a combo box editable) prevent the value-relation to be correctly used. Indeed, opening the form of a feature of the pipe layer (the layer being editable mode), will not give the correct identifier for the value relation but will return a NULL value instead (i.e. NULL wil saved in column material in table pipe). Hope, this is clearer! |
Author Name: Jürgen Fischer (@jef-n) Denis Rouzaud wrote:
Making it editable means that you can enter new values. That is not supported as that would mean that new values need to be added to the related table. So changing the value of the combobox produces as NULL value.
|
Author Name: Denis Rouzaud (@3nids) Okay, I understand. But there is no way to turn around this? This is strange that if you type the first chars and press enter, the value is effectively in the table, so this should not be null, right? |
Author Name: Jürgen Fischer (@jef-n) Denis Rouzaud wrote:
That could be changed, sure. But for now it's unexpected. Currently qgis doesn't expect the value to be changed and just inspects the selected index and takes the key associated to it.
|
Author Name: Paolo Cavallini (@pcav)
|
Author Name: Pirmin Kalberer (Pirmin Kalberer)
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Denis Rouzaud (@3nids) Why turning it back to open? |
Author Name: Denis Rouzaud (@3nids)
|
Author Name: Denis Rouzaud (@3nids)
Original Redmine Issue: 4749
Redmine category:vectors
In QtDesigner, when checking the editable option for a combo box, and using this UI as an edit form in qgis, when editing the attribute, it will return a NULL value.
I could observe this NULL value using a postgis view with no update rule, QGIS gave me some part of SQL code as an error, and I saw there were NULL values.
The text was updated successfully, but these errors were encountered: