{ "id": "93042", "key": "TIMOB-9482", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-03-19T06:22:12.000+0000", "created": "2012-06-11T11:28:13.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:50:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem description\r\nAdding a listener for the 'close' event inside an 'open' event is not working. Other events (e.g. 'click' works fine)\r\n\r\nh2. Steps to reproduce\r\n1. create an app with the code below\r\n2. open the app and click on the button: a new window opens\r\n3. click the back button: the close event is not fired\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow ({\r\n title: \"Win\",\r\n background: 'black'\r\n});\r\n\r\nvar btn = Ti.UI.createButton ({\r\n title: 'click me',\r\n left: 10,\r\n right: 10,\r\n top: 20\r\n});\r\n\r\nbtn.addEventListener ('click', function (e) {\r\n var win2a = Ti.UI.createWindow ({\r\n backgroundColor: '#ccf',\r\n layout: 'vertical'\r\n });\r\n win2a.addEventListener ('open', function (e) {\r\n win2a.addEventListener ('close', function (e) {\r\n Ti.API.debug ('event: close');\r\n alert('this will now show up');\r\n });\r\n });\r\n\r\n win2a.open();\r\n});\r\n\r\nwin.add (btn);\r\n\r\nwin.open();\r\n{code}\r\n\r\n\r\nh2. Additional Notes\r\nNote 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.\r\n\r\nCustomer ticket: http://support.appcelerator.com/tickets/APP-646612\r\n", "attachment": [], "flagged": false, "summary": "Android: close event listener is not added when called inside an open event", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Product: Mobile\r\nTitanium SDK: Mobile 2.0.1\r\nPlatform OS: Android\r\nPlatform OS Version: 2.3", "comment": { "comments": [ { "id": "242856", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue does not reproduces with\r\n\r\nTitanium Studio, build: 3.0.1.201212181159\r\nTitanium SDK version: 3.1.0 (03/11/13 15:43 0c88429)\r\nTitanium SDK version: 3.0.2 (02/07/13 16:46 a4def81)\r\nDevice: Samsung galaxy s duos Android version: 4.0.4\r\n\r\njithinpv", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-19T06:22:12.000+0000", "updated": "2013-03-19T06:22:12.000+0000" }, { "id": "414498", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:50:35.000+0000", "updated": "2017-03-21T21:50:35.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }