Description
If I do not add a picker to the window showTimePickerDialog method does not work.
Testing Environment:
Titanium SDK: 3.4.0
Titanium CLI: 3.4.0
Android SDK :4.2.2, 4.3, 4.4.2
OS X Version: 10.9.5,
Appcelerator Studio: 3.4.1
Steps to Reproduce:
1. Create a Classic project.
2. Paste this code in app.js file.
3. Run this code with the testing environment.
4. Click the time button time picker is not shown.
5. Add the picker to the window and click the button time picker is shown.
*Test Code*
var win = Ti.UI.createWindow({
backgroundColor : 'white',
layout : 'vertical'
});
var timePicker = Ti.UI.createPicker({
//top : 1000
});
// Create a Button.
var time = Ti.UI.createButton({
title : 'Time',
height : 50,
width : 100,
top : 20,
});
// Listen for click events.
time.addEventListener('click', function() {
timePicker.showTimePickerDialog({
callback : function(e) {
if (e.cancel) {
Ti.API.info('User canceled dialog');
} else {
Ti.API.info('User selected Time: ' + e.value);
}
}
});
});
win.add(time);
//win.add(timePicker);
win.open();
Thanks.
When you create a timePicker, you've not yet added it into the visual hierarchy. You need to add it to the window before showing it. Even if you assume that picker.showTimePickerDialog() should automatically add the picker to some window and show it, which window would it target? We could update the documentation to make this explicitly stated.
Closing ticket as invalid.