Skip to content
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

Closed
qgib opened this issue Jan 4, 2012 · 10 comments
Closed

editable option for combo box in value relation editor cannot be used #14618

qgib opened this issue Jan 4, 2012 · 10 comments
Labels
Feature Request Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Jan 4, 2012

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.

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Giovanni Manghi (@gioman)


Can you please explain better the issue?


  • status_id was changed from Open to Feedback
  • priority_id was changed from High to Normal

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

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!

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2012

Author Name: Jürgen Fischer (@jef-n)


Denis Rouzaud wrote:

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.

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.


  • category_id was changed from Data Provider/PostGIS to Vectors

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2012

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?

@qgib
Copy link
Contributor Author

qgib commented Apr 17, 2012

Author Name: Jürgen Fischer (@jef-n)


Denis Rouzaud wrote:

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?

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.


  • tracker_id was changed from 1 to 2

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2012

Author Name: Pirmin Kalberer (Pirmin Kalberer)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - Nice to have

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2014

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Jun 22, 2014

Author Name: Denis Rouzaud (@3nids)


Why turning it back to open?
I filled this request from a misunderstanding at the origin.
Is there a will to implement such functionality?
I am not sure it is worth it.

@qgib
Copy link
Contributor Author

qgib commented Dec 12, 2014

Author Name: Denis Rouzaud (@3nids)


  • status_id was changed from Open to Closed

@qgib qgib added Feature Request Vectors Related to general vector layer handling (not specific data formats) labels May 24, 2019
@qgib qgib added this to the Future Release - Nice to have milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant