Expected:
With tables and other objects, you can pass either explicit objects or anonymous objects. I expected to be able to do this with the picker, too.
Actual:
On iOS, you can create a picker with anonymous objects. On Android, you cannot. You get an empty picker.
Additionally, if you set the useSpinner=true property with a picker created with anonymous objects, it causes a force-close of the app.
var picker = Ti.UI.createPicker({
/*useSpinner: true*/
});
var data = [];
/*
// this works on Android
data[0]=Ti.UI.createPickerRow({title:'Bananas',custom_item:'b'});
data[1]=Ti.UI.createPickerRow({title:'Strawberries',custom_item:'s'});
data[2]=Ti.UI.createPickerRow({title:'Mangos',custom_item:'m'});
data[3]=Ti.UI.createPickerRow({title:'Grapes',custom_item:'g'});
*/
// this does not, but works on iOS
data[0]={title:'Bananas',custom_item:'b'};
data[1]={title:'Strawberries',custom_item:'s'};
data[2]={title:'Mangos',custom_item:'m'};
data[3]={title:'Grapes',custom_item:'g'};
// turn on the selection indicator (off by default)
picker.selectionIndicator = true;
picker.add(data);
win1.add(picker);
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.