Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23162] Windows: Cannot add data to Picker on SDK 5.4.0

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.4.0
Fix Version/sn/a
Componentsn/a
Labelspicker, windows_phone, windowsphone
Reporterjmarty
AssigneeUnknown
Created2016-04-04T11:22:53.000+0000
Updated2018-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();

Comments

No comments

JSON Source