{ "id": "86286", "key": "TIMOB-8346", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13277", "name": "Sprint 2012-08", "archived": true, "released": true, "releaseDate": "2012-04-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-12T03:40:34.000+0000", "created": "2012-02-09T13:46:29.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "ios", "module_navgroup", "parity", "qe-testadded", "regression" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-27T12:15:07.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2.Problem\r\nThe \"open\" event of a window fires 3 times when first opened, then whenever the window re-receives focus (when navigating back to it using a NavigationGroup), the \"open\" event fires again.\r\n\r\nh2.Expected Result\r\nThe \"open\" event should only fire once...when it is first opened, period. And it should not fire when the window re-receives focus.\r\n\r\nh2.Steps to Reproduce\r\n# drop the following app.js code into a new project\r\n# build with SDK 1.8.1\r\n# run in the iPhone simulator. You will see:\r\n{code}\r\n[INFO] One moment, building ...\r\n[INFO] Titanium SDK version: 1.8.1 (01/27/12 17:31 a24502a)\r\n[INFO] iPhone Device family: iphone\r\n[INFO] iPhone SDK version: 5.0\r\n[INFO] iPhone simulated device: iphone\r\n[INFO] Launching application in Simulator\r\n[INFO] Launched application in Simulator (3.78 seconds)\r\n[INFO] Found 5.0 patch installed\r\n[INFO] Application started\r\n[INFO] NavGroupFocusTest/1.0 (1.8.1.a24502a)\r\n[INFO] rootWin OPEN fired\r\n[INFO] rootWin OPEN fired\r\n[INFO] rootWin OPEN fired\r\n{code}\r\n# Say to yourself: \"Why did OPEN fire 3 times?!?!?!?!?!\"\r\n# click the \"open new window\" button and watch the console log. You will see:\r\n{code}\r\n[INFO] 2nd wind\r\n{code}\r\n# click the \"back\" button and watch the console log. You will see:\r\n{code}\r\n[INFO] rootWin FOCUSED\r\n[INFO] rootWin OPEN fired\r\n{code}\r\n# Say to yourself: \"Why did OPEN fire again?!?!?!?!?!\"\r\n\r\nRepeat steps 5, 6, and 7 and continue to get the same result until you're bored with this game.\r\n\r\nh2.Testcase\r\n{code:title=app.js}\r\nvar rootWin = Ti.UI.createWindow();\r\nrootWin.addEventListener('focus', function()\r\n{\r\n Ti.API.info(\"rootWin FOCUSED\");\r\n});\r\n\r\nrootWin.addEventListener('open', function()\r\n{\r\n Ti.API.info(\"rootWin OPEN fired\");\r\n});\r\n\r\nvar btnOpenWin = Ti.UI.createButton({\r\n title : \"open new window\",\r\n width : 200,\r\n height : 35\r\n});\r\n\r\nbtnOpenWin.addEventListener('click', function()\r\n{\r\n var win2 = Ti.UI.createWindow();\r\n ng.open(win2, {animated:true});\r\n Ti.API.info(\"2nd wind\");\r\n});\r\n\r\nrootWin.add(btnOpenWin);\r\n\r\nng = Ti.UI.iPhone.createNavigationGroup({window:rootWin});\r\nvar NavBase = Ti.UI.createWindow();\r\nNavBase.add(ng);\r\nNavBase.open(); // this opens the \"root\" window, automatically\r\n{code}\r\n\r\n\r\nIn a larger project, sometimes when you go \"back\" to the main window, no events fire at all (no focus, no open). I would expect the focus event to fire each time. Just something to keep in mind while you're looking into the code, as I haven't been successful in reproducing this in a small testcase.\r\n", "attachment": [], "flagged": false, "summary": "iOS: \"open\" event fires multiple times at startup, plus whenever focused when using NavigationGroup", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "- iOS SDK 5.0\r\n- iPhone simulator\r\n- Mac OSX 10.7.2\r\n- Titanium SDK 1.8.1\r\n- Titanium Studio 1.0.8.201201262211", "comment": { "comments": [ { "id": "188968", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-28T06:01:34.000+0000", "updated": "2012-03-28T06:01:34.000+0000" }, { "id": "189010", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "I can confirm that the issue related to step 6 still exists. I have moved this ticket to the appropriate section.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-03-28T10:15:08.000+0000", "updated": "2012-03-28T10:15:08.000+0000" }, { "id": "190957", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/2004", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-13T15:09:08.000+0000", "updated": "2012-04-13T15:09:08.000+0000" }, { "id": "191313", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Verified fixed in SDK 2.1.0.v20120416160358. Thanks!\r\n", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-17T06:14:24.000+0000", "updated": "2012-04-17T06:14:24.000+0000" }, { "id": "199164", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.1.0.201206172244\r\nTi Mobile SDK 2.1.0.v20120618154152 hash r7830c03d\r\nOSX Lion 10.7.3\r\niPhone 4S OS 5.1\r\n\r\nThe expected behavior is shown", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T13:28:22.000+0000", "updated": "2012-06-19T13:28:22.000+0000" }, { "id": "202889", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-12T03:40:03.000+0000", "updated": "2012-07-12T03:40:03.000+0000" }, { "id": "281621", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR link:\nhttps://github.com/appcelerator/titanium_mobile/pull/5038", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-27T12:15:07.000+0000", "updated": "2013-11-27T12:15:07.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }