Hello Guys, i want a Picker with two Columns. i check the columns, i get a valid result but open the App is my Picker empty. this is my code for create the PickerView
/* * PickerView */ pickerView = Ti.UI.createView({ zIndex : 1, backgroundColor : "white", height : "85%", width : "85%", borderWidth : 1, borderColor : "black", borderRadius : 10, opacity : 0 }); var modullLabel = Ti.UI.createLabel({ top : 10, right : 2, width : "40%", text : "modullLabel", textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER }); var locationLabel = Ti.UI.createLabel({ top : 10, left : 2, width : "40%", text : "locationLabel", textAlign : Ti.UI.TEXT_ALIGNMENT_CENTER }); var finishedButton = Ti.UI.createButton({ title : "Fertig", width : "100%", height : 50, bottom : 0, style : Titanium.UI.iPhone.SystemButtonStyle.BORDERED }); modulPickerColumn = Ti.UI.createPickerColumn(); var allModulRow = Ti.UI.createPickerRow({ titel : "All Modules", value : 0 }); locationPickerColumn = Ti.UI.createPickerColumn(); var allLocationsRow = Ti.UI.createPickerRow({ titel : "All Locations", value : 0 });my functions
function loadLocations() { var locationURL = api.createURL(Alloy.CFG.apiURL, api.paths.locations); api.getContentFromURL(locationURL, api.urlInfoKey.locations, timeout, activityIndicatorView, function(objects) { if (objects != null && objects != 0) { for (var index in objects) { var row = Ti.UI.createPickerRow({ titel : objects[index][keyBundle.keys.locationTitel], value : objects[index][keyBundle.keys.locationID] }); locationPickerColumn.addRow(row); } var picker = Ti.UI.createPicker({ columns : [modulPickerColumn, locationPickerColumn], selectionIndicator : true }); Ti.API.info(picker.columns[0].rows[0].titel);// the output is all Modules // the output is All Modules pickerView.add(picker); removeActivitIndicatorView(activityIndicatorView); isPickerCreated = true; animationPicker(); } }, function(error, activityIndicatorView) { if (activitIndicatorView) { removeActivitIndicatorView(activityIndicatorView); } showHTTPClientErrorView(error); }); } function loadModuls() { var modulURL = api.createURL(Alloy.CFG.apiURL, api.paths.moduls); api.getContentFromURL(modulURL, api.urlInfoKey.moduls, timeout, activityIndicatorView, function(objects) { if (objects != null && objects != 0) { for (var index in objects) { var row = Ti.UI.createPickerRow({ titel : objects[index][keyBundle.keys.modulTitel], value : objects[index][keyBundle.keys.modulID] }); modulPickerColumn.addRow(row); } loadLocations(); } }, function(error, activityIndicatorView) { if (activitIndicatorView) { removeActivitIndicatorView(activityIndicatorView); } showHTTPClientErrorView(error); }); } loadModuls();i think the problem is i working with the UI Elements don't of the main thread. thanks in advance