{ "id": "79526", "key": "TIMOB-5080", "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": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-01-29T00:00:52.000+0000", "created": "2011-08-22T16:04:47.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "module_network", "qe-closed-3.2.3", "qe-manualtest", "supportTeam" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" }, { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-07T21:50:02.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": "h3.Bug\r\n\r\nh3.Problem:\r\n\r\nTitanium.Network.addEventListener does not fire after creating new tabgroup.\r\n\r\nh3. Reproducible steps:\r\n\r\n1.Run the code below.\r\n2.Without clicking on 'Log In' button please change the network status on your Android device - the Titanium.Network event should be fired\r\n3.Click on the 'Log In' button, after that new tabgroup will be created.\r\n4.Change network status on your Android device - the event is no longer fired.\r\n\r\nh3.Expected behavior\r\n\r\nCustomer wants that the Titanium.Network.addEventListener would be a global listener (that would appear only once in the code). That should be the correct behaviour.\r\n\r\nh3.Sample Code:\r\n{code}\r\n\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win0 = Titanium.UI.createWindow();\r\n\r\nvar btnLogin = Titanium.UI.createButton({\r\n\ttitle:'Log In',\r\n\tcolor:'Black',\r\n\tleft:50,\r\n\theight:30,\r\n\tright:50\r\n});\r\nwin0.add(btnLogin);\r\n\r\nvar tab0 = Titanium.UI.createTab({ \r\n title:'Log In',\r\n window:win0\r\n});\r\n\r\ntabGroup.addTab(tab0); \r\ntabGroup.open();\r\n\r\nfunction BuildTabGroup(ActiveTabIndex){\r\n\t// create tab group\r\n\tvar tabGroup2 = Titanium.UI.createTabGroup();\r\n\tvar mainWin= Titanium.UI.createWindow();\r\n\tvar tab0 = Titanium.UI.createTab({\r\n\t window:mainWin\r\n\t});\r\n\ttabGroup2.addTab(tab0); \r\n\ttabGroup2.open();\r\n}\r\n\r\nif (!Titanium.Network.online) {\r\n\tvar noNetworkAlert = Titanium.UI.createAlertDialog({\r\n\t\ttitle: 'Network Error',\r\n\t\tmessage: \"You do not appear to have network connectivity. You will need an internet connection to use this application.\",\r\n\t\tbuttonNames: ['OK']\r\n\t});\r\n\tnoNetworkAlert.show();\r\n}\r\n\r\nTitanium.Network.addEventListener('change', function(e){\r\n\tvar online = e.online;\r\n\tif (online) {\r\n\t\talert(\"Network connection re-established. You are now using your \" + Titanium.Network.networkTypeName + \" internet connection.\");\r\n\t}\r\n\telse {\r\n\t\talert(\"Your network connectivity has been lost. Check your device settings.\");\r\n\t}\r\n});\r\n\r\nbtnLogin.addEventListener('click',function(){\r\n\tvar tbg = Titanium.UI.currentTabGroup;\r\n\ttbg.close();\r\n\ttbg = null;\r\n\tBuildTabGroup(0);\r\n});\r\n\r\n{code}\r\n\r\nh3. HelpDesk.\r\n\r\nAPP-287557\r\n\r\n\r\n\r\n\r\n", "attachment": [ { "id": "22634", "filename": "app.js", "author": { "name": "framirez", "key": "framirez", "displayName": "Francisco Antonio Duran Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-22T16:04:47.000+0000", "size": 1355, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Titanium.Network.addEventListener does not fire after creating new tabgroup", "creator": { "name": "framirez", "key": "framirez", "displayName": "Francisco Antonio Duran Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "framirez", "key": "framirez", "displayName": "Francisco Antonio Duran Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.1, 2.2, and 2.3.3\r\nTi SDK 3.2.0.GA\r\nTi CLI 3.2.0\r\n", "comment": { "comments": [ { "id": "201533", "author": { "name": "falk", "key": "falk", "displayName": "MAIRDUMONT GmbH & Co. KG", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Wonder when this will be resolved?\r\nIs there any other workaround than checking any x sec if Ti.Network.online has changed?", "updateAuthor": { "name": "falk", "key": "falk", "displayName": "MAIRDUMONT GmbH & Co. KG", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-05T02:09:50.000+0000", "updated": "2012-07-05T02:09:50.000+0000" }, { "id": "203002", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on a Samsung Galaxy S2 with 2.1GA. First time I open the app, it gives me an alert. I change the network status of the device and press the log in button. It comes up with a runtime error saying \"Uncaught TypeError: Cannot call method 'close' of undefined. Source: tag.close();\"\r\n\r\nNo network changed event seems to be firing.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-07-12T13:17:28.000+0000", "updated": "2012-07-12T13:17:28.000+0000" }, { "id": "290126", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving this as per updated test results. We tested the issue with TISDK 3.2GA and we could not reproduce it.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-29T00:00:52.000+0000", "updated": "2014-01-29T00:00:52.000+0000" }, { "id": "296761", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Titanium.Network.addEventListener is working as expected.\r\n\r\nVerified the fix using:\r\nDevice : Google Nexus 4, Android Version: 4.1.1\r\nSDK: 3.2.3.v20140311115447\r\nCLI version : 3.2.1\r\nOS : MAC OSX 10.9\r\nAlloy: 1.3.1\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nAppcelerator Studio, build: 3.2.2.201403061827\r\ntitanium-code-processor: 1.1.0\r\nXCode : 5.1 ", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-12T11:19:51.000+0000", "updated": "2014-03-12T11:19:51.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }