Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7696] Android: UI.AlertDialog - removing/ignoring options property if set to prevent picker being added

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T22:04:32.000+0000
Affected Version/sRelease 1.8.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterPaul Dowsett
AssigneeEric Merriman
Created2012-02-16T16:10:21.000+0000
Updated2017-05-02T22:04:32.000+0000

Description

Problem

When both of the an options (invalid) and buttonNames (valid) properties are defined, both picker and button views are displayed together in the dialog. See attached screenshot. Options are not part of the AlertDialog API, which is in contrast to the OptionDialog API that can show both on Android, and has complimentary click event properties to support it. See [options_dialog.js](https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/options_dialog.js) to demonstrate that it is valid for OptionDialog. I would suggest removing/ignoring the options property if set for AlertDialog. This is not an issue on iOS.

Test case

Ti.UI.setBackgroundColor('white');
var win = Ti.UI.createWindow({  
    title: 'Click window to test',
    backgroundColor: 'white',
	exitOnClose: true,
	fullscreen: false
});

win.addEventListener('click', function(e){
	var opts = {};
	opts = {
		cancel: 2,
		destructive: 1,
		options: ['Confirm', 'Cancel', 'Help'],
		buttonNames: ['Confirm', 'Cancel', 'Help'],
		title: 'Delete File?'
	};
	var dialog = Ti.UI.createAlertDialog(opts).show();
});
win.open();

Attachments

FileDateSize
5560_titanium_4_WVGA854-1.png2012-02-16T16:11:09.000+000085355

Comments

  1. Lee Morris 2017-05-02

    Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.

JSON Source