OK, now I have a second documented occurrence of wierdness going on at the variable type level. The fix is that you have to add an empty string to coerce the correct data type.
The first was brought up here:
http://forum.servoy.com/viewtopic.php?t=771
Here’s my current two hours of wracking my brain for the bug. Notice line 9 where I have to add a couple of ticks or else the value list is not set:
//set field names array for controller search function
var form_fields = new Array;
for ( var i = 0 ; i < forms[theForm].elements.length ; i++ )
{
if (utils.stringLeft(forms[theForm].elements[i].getName(),3) == 'fd_')
{
form_fields[i] = utils.stringMiddle(forms[theForm].elements[i].getName(), 4, 100) + '';
}
}
application.setValueListItems('search_fields', form_fields);
This does work however so I think the getName() function is the culprit:
someArray = new Array("Hello", "Goodbye");
application.setValueListItems('search_fields', someArray);
- david