Project: titanium
Issue TIMOB-19225: Windows: Wrong callback for AlertDialog
{{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. {code} 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(); {code}
Story points: 8