If I know the value of the return in dataprovider for a valuelist, can I get its corresponding show in list value?
I know I can use application.getValueListItems to get a list of all of the items in a valuelist but I can’t see the return in dataprovider value in its dataset.
Here is the code I wrote thats not working:
var myList = arguments[0]
var myID = arguments[1]
var dataset = application.getValueListItems(myList);
for(var i = 1 ;i <= dataset.getMaxRowIndex() ;i++ )
{
dataset.rowIndex = i;
if (myID == dataset[0]) {
return dataset[1];
}
}
add before the “if” a line like:
application.output("dataset[0] “+dataset[0]+” dataset[1] "+dataset[1]);
and check the output debug window for the returned data.
Ah, there is indeed a problem with 0 based array access, will be fixed in Servoy 2.1.2, in the meantime use dataset.getValue(row,col) (1 == first row/column)