Details
-
Type:
Bug
-
Status: Reopened
-
Priority:
Low
-
Resolution: Unresolved
-
Affects Version/s: Release 3.2.0, Release 9.1.0
-
Fix Version/s: Release 3.0.2, Release 3.1.0, 2012 Sprint 25, 2012 Sprint 25 API
-
Component/s: Android
-
Environment:
Android 2.1.3,2.3.3
Android 4.1, Android 6.0
Description
Problem description
Adding a picker to an alert dialog does not work on Android.
Steps to reproduce
- Use this code to reproduce the bug:
var win = Titanium.UI.createWindow({
|
title : 'Bug Isolation',
|
backgroundColor : 'white',
|
barColor : '#0066CC',
|
navBarHidden : false,
|
tabBarHidden : true
|
});
|
|
var alertView = Ti.UI.createView({
|
top : '0dp'
|
});
|
|
var monthPicker = Ti.UI.createPicker({
|
top : '5dp',
|
width : '150dp',
|
left : '5dp'
|
});
|
|
var months = [];
|
months[0]=Ti.UI.createPickerRow({title:'January'});
|
months[1]=Ti.UI.createPickerRow({title:'February'});
|
months[2]=Ti.UI.createPickerRow({title:'March'});
|
months[3]=Ti.UI.createPickerRow({title:'April'});
|
months[4]=Ti.UI.createPickerRow({title:'May'});
|
months[5]=Ti.UI.createPickerRow({title:'June'});
|
months[6]=Ti.UI.createPickerRow({title:'July'});
|
months[7]=Ti.UI.createPickerRow({title:'August'});
|
months[8]=Ti.UI.createPickerRow({title:'September'});
|
months[9]=Ti.UI.createPickerRow({title:'October'});
|
months[10]=Ti.UI.createPickerRow({title:'November'});
|
months[11]=Ti.UI.createPickerRow({title:'December'});
|
|
monthPicker.add(months);
|
monthPicker.selectionIndicator = true;
|
|
var yearPicker = Ti.UI.createPicker({
|
top : '5dp',
|
width : '100dp',
|
right : '5dp'
|
});
|
|
var years = [];
|
var yearRange = {min: new Date().getFullYear(), max: (new Date().getFullYear() + 10)}
|
for (var i = yearRange.min; i <= yearRange.max; i++){
|
var item = Ti.UI.createPickerRow({title: i.toString()});
|
years.push(item);
|
}
|
|
yearPicker.add(years);
|
yearPicker.selectionIndicator = true;
|
|
alertView.add(monthPicker);
|
alertView.add(yearPicker);
|
|
var expDateAlert = Ti.UI.createAlertDialog({
|
title : 'Exp. Date:',
|
buttonNames : ['Set', 'Cancel'],
|
cancel : 1,
|
androidView : alertView
|
});
|
|
expDateAlert.addEventListener('click', function(e){
|
if (e.index == 0){
|
Ti.API.info('monthPicker: ' + JSON.stringify(monthPicker.getSelectedRow(0).title));
|
Ti.API.info('yearPicker: ' + JSON.stringify(yearPicker.getSelectedRow(0).title));
|
}
|
});
|
|
var button = Ti.UI.createButton({
|
title : 'click me',
|
bottom : '5dp',
|
height : '50dp',
|
width : '200dp'
|
});
|
|
button.addEventListener('click', function(e){
|
expDateAlert.show();
|
});
|
|
win.add(button);
|
|
win.open();
|
- Run the app and click the button: a dialog appears
- Try to use the picker views: they won't work
Attachments
Issue Links
- relates to
-
TIMOB-12341 Backport TIMOB-11569 to 3.0.2
-
- Closed
-