TEXT_FIELD with a value list do not accept other values.

Hi,

A TEXT_FIELD or TYPE_AHEAD that has a value list attached do not accept other values then the ones in the value list, although in the SmartClient they do! The database field that is bound with the control field is of type TEXT.

Is there any way so they can accept other text values then those form the value list also in the WebClient?

Thanks,
Bogdan.

If your valuelist has different display and real values, then you can only enter values that are in the valuelist.
If the display and real value of your valuelist are the same, then you can also enter other values.

This should work the same in both smart and webclient.

Which Servoy version do you use?

5.2.9

The display and real values are different. In SmartClient I can fill in other values different from the real or display values from the value list which is OK. But not in the WebClient.

Hi,

If you think you need to fix this, please don’t fix it as you described that it should work! Let the user fill in anything he wish in the TEXT_FIELD or TYPE_AHEAD, even if it’s in the value list or not.

That display value == real value issue doesn’t make sense for the user!

If you need, I can make a case with a feature request or bug, whatever you want!

Thanks,
Bogdan.

udrescu_bogdan:
In SmartClient I can fill in other values different from the real or display values from the value list

Will anything be saved in the database then? I don’t think that should be possible.

udrescu_bogdan:
That display value == real value issue doesn’t make sense for the user!

No, but why do you use it anyway if the user should be able to just type in anything?

Will anything be saved in the database then? I don’t think that should be possible.

Yes, it is saved correctly in the database!

No, but why do you use it anyway if the user should be able to just type in anything?

In the fields for which I have the problem, the user fills in the ICAO code of an airport which is composed of 4 uppercase chars. We have in our value list most of the airports ICAO codes around the world, and in the display value we also display the location/city/country/whatever. But, in case one airport is not present there we just want the user to type whatever he wants. In the database we save only the ICAO code.

Ok. Well, if something like this behaves differently in web and smartclient, than that is most likely a bug. Please create a case about that in the support system with a sample solution attached: http://www.servoy.com/s

this is weird if you use a TextField with a valuelist that has real and display values then it shouldn’t be possible to get a typed value in
That only works if it only has display values (or only real depending on how you see it)

i just did a quick test in 6 (and looked at the code from 5 which is the same) and a null is generated for a input that can’t be resolved in the realvalues. So a null will be inserted.

I can use a TYPE_AHEAD or a COMBOBOX, it doesn’t matter as long as the users can type something different then what is in the value list, and that new value will be saved.

But, if you look on the link that I posted in the case I just opened, it behaves like this:

SmartClient - new values typed in are saved with no problem in the database, which I liked. This is what we want!
WebClient - If I type something different, even empty text, when leaving the field it will automatically fills in the first item in the value list. For this I only need to click inside the field so it gets the focus, and then leave, without even typing something. This we don’t like! :)

i have no idea how it is that your first point works then, i just can’t reproduce that behavior. When having a valuelist that has Real And Display values the typed in value must map on a real (through the display that is typed)

Have you tried it also in our online solution, in the SmartClient?

no but then i don’t see the code or how it is configured.

But if you create just a very simple solution 1 textfield build on a text dataprovider
attach a valuelist (lets say a custom with these entries:

tst1|tst1
tst2|tst2
tst3|tst3

can you get something in that field in the database that is not 1 of those?

OK, I see… the problem is that our valuelist has real values different then the display values. Can this be the reason? Because earlier Joas said something about this.

I tested again with the real values == display values and it behaves the same. In SmartClient new data typed by the user is saved in the database, in WebClient the first value from the value list is selected if the data typed does not belong to the value list.

that doesnt matter:

test1|tst1
test2|tst2
test3|tst3
test4|tst4

This is how servoy is designed, that when you have real and display (that means what you see and type is different data then what is in the db) you can’t insert just display data.

jcompagner:
that doesnt matter:

test1|tst1
test2|tst2
test3|tst3
test4|tst4

This is how servoy is designed, that when you have real and display (that means what you see and type is different data then what is in the db) you can’t insert just display data.

Hi!

I have a text_field that has a country value list. I already made my real value and display value both mapped to description but it still does not accept value that is not in my list. i am using servoy6.

please advice.

thanks!

dont use a real|display valuelist, use if you want to accept other values only a display valuelist

jcompagner:
dont use a real|display valuelist, use if you want to accept other values only a display valuelist

I am confused. How do you use a display only value list? In the definition part, I chose countrydescription and tick return to data provider on the first box, and countrydescription and tick show on field/list.

thanks!

if “show” and “return” are the same (for example only the first box is selected by both) then you have a display (or real) only valuelist.

jcompagner:
if “show” and “return” are the same (for example only the first box is selected by both) then you have a display (or real) only valuelist.

wow! its working now. thanks alot!

follow-up question. can we filter the contents of the valuelist at runtime?

i mean, if i enter a country that is in the valuelist, my other textfield with valuelist of states will now be filtered by the entered country.