toPyDataSet issue

Hi,

I am building a program to select from a list box a list of countries, and have the ones that you selected be displayed in a “selected” listbox. However my code to transfer the lists is not working.

The current code is just a test and does not take the selected value.
Any help would be great

[code]Listbox=event.source.parent.getComponent(‘StartLst’)

data=fpmi.db.toPyDataSet(event.source.parent.getComponent(‘StartLst’).data)
newdata=[]

for item in data:
newdata.append(data)

event.source.parent.getComponent(‘SelectList’).data =fpmi.db.toDataSet(newdata)[/code]

You’re close. the fpmi.db.toDataSet takes an array of headers, and an array of rows, each of which is a tuple. try this:

[code]Listbox=event.source.parent.getComponent(‘StartLst’)

data=fpmi.db.toPyDataSet(event.source.parent.getComponent(‘StartLst’).data)
newdata=[]

for item in data:
newdata.append([item[0]])

event.source.parent.getComponent(‘SelectList’).data =fpmi.db.toDataSet([“Country”], newdata)[/code]

Thanks! That worked perfectly.