Hot to Create a combo with an array as data source

Good afternoon from Gran Canaria

I need to create a combobox for a field whose data source is an array and the data provider id a field in a table. I guess that it should be done with a Valuelist, but could anyone tell me how to create a ValueList based on an array?

Thanks in advance.

Hi, Juan.

Here is the Servoy method you are looking for:

application.setValueListItems( nameValueList, nameArray )

You must first create a custom valuelist and name it (nameValueList); no other parameters are required.

I hope this helps!

Hi Juan.

Another option is to create a valuelist based on a global function. This function can get real and display values form an array and return a dataset (see the sample code that is created when you create the global function for the valuelist. The function can be called in 3 modes: for return the whole list, a filtered list or a new value that isn“t yet in the valuelist).

Thank you guys.

Now I got it working !!