Valuelist / Combobox problem

I have a table with a list of country and countrycodes (abreviations).

On a form based on another table (companysites) I’ve placed a combobox where the country is shown and the code returned (valuelist : all values from).

But it just doesn’t work. It is always the shown value that is…shown
I don’t say returned because if I set valuelist to none then the fields where I already made a selection contains the country code. :shock:

I don’t understand why the country name still appears when I exist the field.

I’m using servoy 2.1 build 310 with a firebird db.

By the way I add a request (it’s a bit late but…) : could the width of a combobox list depend on the longest word it contains (or a chosen value) not on the field it’s attached to?
I mean the list could fit its values and the field as well!?
(In my case the countrycodes are 2 characters long so if I adjust the field size according to it the country names are hardly readables…)

I believe that this is normal behavior. The field in the database contains the country code as you want, but because the dataprovider you have displayed on your form is attached to a value list, and the value list displays the full country name, that is what you see. If you put another field on your form without that value list attached (or one that just displays the code), you will see the country code that is stored in the database.

Sorry, that’s right, it’s a perfectly normal behaviour. It was a misunderstanding of the option :oops: . I gonna have two fields based on the same dataprovider, one editable/combobox showing the country name and the other non editable showing the stored countrycode in the formated addresses.

Thanks