[TIMOB-23162] Windows: Cannot add data to Picker on SDK 5.4.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 5.4.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | picker, windows_phone, windowsphone |
Reporter | jmarty |
Assignee | Unknown |
Created | 2016-04-04T11:22:53.000+0000 |
Updated | 2018-02-28T19:55:59.000+0000 |
Description
When I try to add data to Picker, my application crash with Unknown exception.
I tried with SDK 5.2.0.GA and it's work. But on SDK 5.4.0.v20160402025807 it crash.
I tried this
var picker = Ti.UI.createPicker({
columns: [ column1, column2 ]
});
==> CRASH
and I tried to create the picker and after add columns or data like this and it crash too.
picker.add([ column1, column2 ]);
==> CRASH
OR
picker.add(data1);
==> CRASH
OR
picker.add([data1]);
==> CRASH
Please help.
The source code :
//index.xml
<Alloy>
<Window class="container" onClick="doClick">
</Window>
</Alloy>
//index.js
function doClick(e) {
var win = Ti.UI.createWindow({});
var data1 = [];
data1[0] = Ti.UI.createPickerRow({ title: 'Bananas'});
data1[1] = Ti.UI.createPickerRow({ title: 'Strawberries'});
data1[2] = Ti.UI.createPickerRow({ title: 'Mangos' });
data1[3] = Ti.UI.createPickerRow({ title: 'Grapes' });
var data2 = [];
data2[0] = Ti.UI.createPickerRow({ title: 'red', color: 'red', font: { fontSize: 30, fontFamily: 'Times New Roman' } });
data2[1] = Ti.UI.createPickerRow({ title: 'blue', color: 'blue' });
data2[2] = Ti.UI.createPickerRow({ title: 'yellow', color: 'yellow' });
data2[3] = Ti.UI.createPickerRow({ title: 'green', color: 'green' });
var column1 = Ti.UI.createPickerColumn();
var column2 = Ti.UI.createPickerColumn();
for (var i = 0; i < data1.length; i++) {
column1.addRow(data1[i]);
}
for (var i = 0; i < data2.length; i++) {
column2.addRow(data2[i]);
}
var picker = Ti.UI.createPicker({
columns: [ column1, column2 ]
});
// picker.add([ column1, column2 ]);
picker.addEventListener('change', function (e) {
Ti.API.info("User selected: " + JSON.stringify(e.selectedValue));
});
win.add(picker);
win.open();
}
$.index.open();
No comments