It appears that if you have an uneditable combobox, and the value in the field is not in the value list, the value does not display.
This could occur for any number of reasons, including a value list set at run time, a value having been removed from the value list table, a value being entered outside of servoy, etc.
I can reproduce this in a simple, one-field, one-value list solution. Create a custom value list with 1 through 5 as values. Create two instances of the same field on a form, one of which is a text_field and the other of which is an uneditable combobox using the value list. Using the text_field occurrence of the field, enter ‘7’. It will show in the text_field, but not in the combobox.
I haven’t found reference to this in the help or manuals, but in case this is, for some reason, intended functionality, could someone suggest a workaround?
When a field is non-editable we are not allowed to change the content. When you have a value in your field that is not in the valuelist, you are ‘editing/changing’ the allowed values and as such doing something that you don’t want.
I really don’t want it to be editable. Just because something was a valid choice a year ago doesn’t mean it’s a valid choice now, or that the user can enter whatever they want. By the same token, that value that was valid a year ago IS in records, and SHOULD be visible to users, even though they can’t select it now.
The value list that I noticed this on is ‘soucrce’ (“Where did you hear about us?”) I originally had this set as a runtime value list, and had it get the current advertisements, plus a few like “salesperson” , “referral”, “other”, etc. The idea here is that advertisements will come and go.
What’s the value of NOT displaying the value stored in the dataprovider?
I can work around this behavior, but it seems counter-intuitive and a little bizarre to me. Value lists aren’t EVER carved in stone, and changing a value list shouldn’t change how existing records display.
I hope this isn’t standard functionality, but if it is, I think I’ll make it a point to avoid a non-editable combo box. A value list is a nice data entry tool, but I don’t want it to filter the data I’m displaying to users.
One technique I use for this situation is to use two fields for the same data provider placed on top of one another. the Input capable field is shown as a combobox with a valuelist of only the valid choices for the dataprovider. The other field is not input capable and shows as a text_area or text_field. A method that test whether editing is possible sets one field to visible, the other to not visible.