Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19225] Windows: Wrong callback for AlertDialog

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-07-17T14:12:46.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2015-07-16T03:11:07.000+0000
Updated2015-07-27T22:03:10.000+0000

Description

AlertDialog "click" callback fires wrong callback function. For example following code should print "Callback from Push 1" when you push Push1 button, and should print "Callback from Push 2" when you push Push2.
var win = Ti.UI.createWindow({layout:'vertical'});

var btn1 = Ti.UI.createButton({ title: 'Push 1' });
btn1.addEventListener('click', function (e) {
    var dialog = Ti.UI.createAlertDialog({
        message: 'Okay 1',
        title: 'Alert Dialog Test 1'
    });
    dialog.addEventListener('click', function (e) {
        Ti.API.info('Callback from Push 1');
    });
    dialog.show();
});
win.add(btn1);

var btn2 = Ti.UI.createButton({ title: 'Push 2' });
btn2.addEventListener('click', function (e) {
    var dialog = Ti.UI.createAlertDialog({
        message: 'Okay 2',
        title: 'Alert Dialog Test 2'
    });
    dialog.addEventListener('click', function (e) {
        Ti.API.info('Callback from Push 2');
    });
    dialog.show();
});
win.add(btn2);

win.open();

Comments

  1. Kota Iguchi 2015-07-16

    https://github.com/appcelerator/titanium_mobile_windows/pull/378
  2. Lokesh Choudhary 2015-07-27

    Verified the fix. Closing. Environment: Appc Studio: 4.1.1.201507141126 Ti SDK: 4.2.0.v20150724170431 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0 APPC CLI: 4.1.2 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1

JSON Source