newbie: getValuelistItems error

Questions, tips and tricks and techniques for scripting in Servoy

newbie: getValuelistItems error

Postby leng » Fri Mar 12, 2004 9:04 am

Hi all

This is my maiden post. :lol: I tried searching but didn't quite get the answer I was looking for.

I need to show a select dialog with items from my value list. Instead of getting a drop down list with the items from my custom value list, I am getting:

JSDataSet:size:3, selectedRow=-1

What am I missing here?

FWIW, there are 3 items in my value list.

var array = application.getValueListItems('valuelistname');
var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name', array)




Thanks.

Leng

XP
1.4.2_03-b02
leng
 
Posts: 2
Joined: Fri Mar 12, 2004 8:45 am

Postby jcompagner » Fri Mar 12, 2004 11:07 am

you have first to convert a JSDataSet to a array (of one column in the set)



var array = application.getValueListItems('valuelistname').getColumnAsArray(0);
var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name', array)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby leng » Sun Mar 14, 2004 7:29 am

var array = application.getValueListItems('valuelistname').getColumnAsArray(0);
var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name', array)


getColumnAsArray(1) seem to work.

Thanks Johan.
leng
 
Posts: 2
Joined: Fri Mar 12, 2004 8:45 am


Return to Methods

Who is online

Users browsing this forum: No registered users and 37 guests

cron