Problem description
Adding a listener for the 'close' event inside an 'open' event is not working. Other events (e.g. 'click' works fine)
Steps to reproduce
1. create an app with the code below
2. open the app and click on the button: a new window opens
3. click the back button: the close event is not fired
var win = Ti.UI.createWindow ({
title: "Win",
background: 'black'
});
var btn = Ti.UI.createButton ({
title: 'click me',
left: 10,
right: 10,
top: 20
});
btn.addEventListener ('click', function (e) {
var win2a = Ti.UI.createWindow ({
backgroundColor: '#ccf',
layout: 'vertical'
});
win2a.addEventListener ('open', function (e) {
win2a.addEventListener ('close', function (e) {
Ti.API.debug ('event: close');
alert('this will now show up');
});
});
win2a.open();
});
win.add (btn);
win.open();
Additional Notes
Note that the event is not added at all: calling a different function inside the 'open' event works just find; also, replacing 'close' with 'click' works fine.
Customer ticket:
http://support.appcelerator.com/tickets/APP-646612
Issue does not reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 jithinpv
Closing ticket as the issue cannot be reproduced and due to the above comments.