TYPE_AHEAD behaviour for values outside valuelist

Hi

I have two fields on a form in table view. Both are of displayType TYPE_AHEAD. They are editable and have a (different) valuelist attached. One dataprovider is of type string, the other of type number.

When a user edits a field and enters a value which is not in the valuelist: what is the expected behaviour? In my form the value for the string is deleted when the user enters a value outside of the valuelist and leaves the field. A number which is not in the valuelist stays. Is this correct?

Thanks for any help. Regards
Birgit

it depends, does the value list have real/display values?
Or is the real and display value of different types?

if you just have a valuelist that has real and display the same text column and you add that to a textfield that is build on a text dataprovider
you can type outside of the valuelist. Then the valuelist is just a helper method.
But if that is not the case it is an id → string then it has to be in the valuelist.

Hi Johan

Both value lists are built via relation (Related Values).

One value list is called “ratings”. Return in dataprovider (=real value) is a text column. Show in field / list (=display value) is an other text column.

The other value list is called “marks”. Real and display values are the same number column.

If I understand you right, “marks” only offer helper values since real and display values are the same. So, the behaviour is as expected. Which I didn’t know. Where can I find this in the documentation? What can I do if I want to force the user to only enter values inside the value list?

Thank you and regards
Birgit

Can anyone answer this question

What can I do if I want to force the user to only enter values inside the value list?

This is for a very simple valuelist: «Show in field» and «Return in dataprovider» use the same column. I did try to use a calc for show in field. But this did not work.

We use TYPE_AHEADs in table views. Since combos look ugly. Is this the problem? Can they not be used for our purpose?

Thanks and regards
Birgit

for this situation fake that it is the same column
So select in 1 box the text column and say this is the show in field
and select in box 2 the same column and say this is the return dataprovider.

Thank you! That works! This is the easiest way.

I thought, I already did try. But obviously not. So I hooked onDataChange, checked the value and deleted it, if it was not in the valuelist. Since the valuelist is used in about 5 forms, I’m quite happy with the easier solution.

Regards
Birgit