No more available in Release3.0 ?

Hello Servoy users,

On version 2.2.5 that was possible to define a display and a store value for the custom value list.

That was possible to define a value displayed and a value stored just by separing the 2 by the following character ‘|’

Woman|1
Man|2
NotApllicable|3

So you see Woman,Man or Not applicable, but 1,2 or 3 are stored in database.

It’s no more working in 3.0. :(

Did Servoy remove the possibility or is it a bug ?

DomTom

Thanks.

Hello,

Is the “editable” property of the field checked or unchecked? It should be unchecked if you’re specifying return values (I made the same mistake recently).

Thank you, you are right.

I would go one step further and construct myself the value lists using SQL and receive the same ability to have a different value store.

But the character ‘|’ is only understand by Servoy on the value list editor.
Did you know a work around ?

DomTom

:) :?:

Take a look at the application.setValueListItems() function, you have to pass two distinct arrays: one for display values and the other for return values.

//Fill a custom type valuelist with values from array(s) or dataset
//set display values (return values will be same as display values)
application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'));
//set display values and return values (which are stored in dataprovider)
//application.setValueListItems('my_en_types',new Array('Item 1', 'Item 2', 'Item 3'),new Array(10000,10010,10456));
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = 'select c1,c2 from test_table';
//var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 25);

//application.setValueListItems('my_en_types',dataset);

There’s no work around for that: It’s just implemented as it should be…

Check the samplecode on the functions that you use to build valuelists bases on SQL.