Perhaps I am missing something obvious but I cannot see a way to select a null value after a value has been selected or to be able to edit the valuelist on the fly and add new values where appropriate?
TIA
Perhaps I am missing something obvious but I cannot see a way to select a null value after a value has been selected or to be able to edit the valuelist on the fly and add new values where appropriate?
TIA
Probably you are looking for application.setValueListItems
application.setValueListItems( name, display_val_array/dataset, [real_values_array])
From servoy developer move sample:
//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);
You will be able to select an empty value if you select “allow empty value” when defining your valuelist in the “define valuelist” form.