{ "id": "160146", "key": "TIMOB-23349", "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": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-12T15:39:19.000+0000", "created": "2016-05-10T09:41:23.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-5.3.0" ], "versions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "issuelinks": [ { "id": "51666", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "160212", "key": "TIMOB-23366", "fields": { "summary": "Windows: Hardware back button exits app instead of closing window inside tab", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51650", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "147341", "key": "TIMOB-18856", "fields": { "summary": "Windows: hardware back button should close Ti.Window", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-12T20:59:45.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Looking at other Windows apps the expected behaviour when using {{Ti.UI.Tab.open()}} to open a child Window should be:\r\n\r\n* That the Tabs stay visible (/)\r\n* That the content of the current tab is replaced by the child Window (/)\r\n* That pressing the device back button should close the child Window, reveiling the previous Window again (x)\r\n* That calling {{Ti.UI.Tab.close()}} passing the child window should do the same (x)\r\n* That calling {{Ti.UI.Window.close()}} on the child window should do the same (x)\r\n\r\nThe last three are broken and need to be fixed:\r\n\r\n* Pressing the device back button will close the app.\r\n* Calling close on the Window or via the Tab doesn't do anything.\r\n\r\nIn addition, when the child window has a CommandBar, the CommandBar will be dismissed when you first call {{Ti.UI.Window.close()}}.\r\n\r\nExample for all of this:\r\n\r\n{code:js}\r\nfunction createWindow(depth) {\r\n\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tlayout : 'vertical'\r\n\t});\r\n\r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttext : 'Depth ' + depth\r\n\t}));\r\n\r\n\tvar openBtn = Ti.UI.createButton({\r\n\t\ttop : 20,\r\n\t\ttitle : 'Open Child'\r\n\t});\r\n\r\n\topenBtn.addEventListener('click', function() {\r\n\t\ttabA.open(createWindow(depth + 1));\r\n\t});\r\n\r\n\twin.add(openBtn);\r\n\r\n\tif (depth > 0) {\r\n\t\tvar closeViaWinBtn = Ti.UI.createButton({\r\n\t\t\ttop : 20,\r\n\t\t\ttitle : 'Close via Window'\r\n\t\t});\r\n\r\n\t\tcloseViaWinBtn.addEventListener('click', function() {\r\n\t\t\twin.close();\r\n\t\t});\r\n\r\n\t\twin.add(closeViaWinBtn);\r\n\r\n\t\tvar closeViaTabBtn = Ti.UI.createButton({\r\n\t\t\ttop : 20,\r\n\t\t\ttitle : 'Close via Tab'\r\n\t\t});\r\n\r\n\t\tcloseViaTabBtn.addEventListener('click', function() {\r\n\t\t\ttabA.close(win);\r\n\t\t});\r\n\r\n\t\twin.add(closeViaTabBtn);\r\n\r\n\t\tvar backViaWinButton = Ti.UI.Windows.createAppBarButton({\r\n\t\t\ticon : Ti.UI.Windows.SystemIcon.BACK\r\n\t\t});\r\n\r\n\t\tbackViaWinButton.addEventListener('click', function() {\r\n\t\t\twin.close();\r\n\t\t});\r\n\r\n\t\tvar backViaTabButton = Ti.UI.Windows.createAppBarButton({\r\n\t\t\ticon : Ti.UI.Windows.SystemIcon.BACKTOWINDOW\r\n\t\t});\r\n\r\n\t\tbackViaTabButton.addEventListener('click', function() {\r\n\t\t\ttabA.close(win);\r\n\t\t});\r\n\r\n\t\twin.add(Ti.UI.Windows.createCommandBar({\r\n\t\t\titems : [backViaWinButton, backViaTabButton]\r\n\t\t}));\r\n\t}\r\n\r\n\treturn win;\r\n}\r\n\r\nvar tabA = Ti.UI.createTab({\r\n\ttitle : 'Tab A',\r\n\twindow : createWindow(0)\r\n});\r\n\r\nvar tabB = Ti.UI.createTab({\r\n\ttitle : 'Tab B',\r\n\twindow : Ti.UI.createWindow({\r\n\t\tbackgroundColor : 'green'\r\n\t})\r\n});\r\n\r\nTi.UI.createTabGroup({\r\n\ttabs : [tabA, tabB]\r\n}).open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Windows: Closing Windows opened via Ti.UI.Tab.open() does not work as expected", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "5.3.0 RC", "closedSprints": [ { "id": 627, "state": "closed", "name": "2016 Sprint 10 SDK", "startDate": "2016-05-07T00:43:56.954Z", "endDate": "2016-05-21T00:43:00.000Z", "completeDate": "2016-05-23T02:06:04.349Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "385509", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/680", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-12T06:57:31.000+0000", "updated": "2016-05-12T06:57:31.000+0000" }, { "id": "385536", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Note to QE: This fix has been merged to 5_3_X and master, but doesn't address one of the bullet points Fokke mentions - that of the hardware back button exiting the app instead of closing the tab's window. I've opened up TIMOB-23366 to address that remaining issue, given that I think it should no longer be a blocker for the 5.3.0 sample app/5.3.0 GA.\r\n\r\nSo for testing purposes, please use the example above, or a more elaborate one Kota wrote below (which uses different colors for different depths of windows inside tabs).\r\n\r\nYou're looking to confirm that:\r\n- when you swap between tabs both tabs are still visible.\r\n- When you open a child window in the first tab, that the tabs are still visible\r\n- When you close the tab's child window using either button (close via tab, or close via window), that the child window closes, the commandbar goes away, and the tabs remain.\r\n\r\nExample with colored windows at various depths:\r\n{code:javascript}\r\nvar colors = ['blue', 'gray', 'red'];\r\n\r\nfunction createWindow(depth) {\r\n\r\n var win = Ti.UI.createWindow({\r\n layout: 'vertical',\r\n backgroundColor: colors[depth % colors.length]\r\n });\r\n\r\n win.add(Ti.UI.createLabel({\r\n text: 'Depth ' + depth\r\n }));\r\n\r\n var openBtn = Ti.UI.createButton({\r\n top: 20,\r\n title: 'Open Child'\r\n });\r\n\r\n openBtn.addEventListener('click', function () {\r\n tabA.open(createWindow(depth + 1));\r\n });\r\n\r\n win.add(openBtn);\r\n\r\n if (depth > 0) {\r\n var closeViaWinBtn = Ti.UI.createButton({\r\n top: 20,\r\n title: 'Close via Window'\r\n });\r\n\r\n closeViaWinBtn.addEventListener('click', function () {\r\n win.close();\r\n });\r\n\r\n win.add(closeViaWinBtn);\r\n\r\n var closeViaTabBtn = Ti.UI.createButton({\r\n top: 20,\r\n title: 'Close via Tab'\r\n });\r\n\r\n closeViaTabBtn.addEventListener('click', function () {\r\n tabA.close(win);\r\n });\r\n\r\n win.add(closeViaTabBtn);\r\n\r\n var backViaWinButton = Ti.UI.Windows.createAppBarButton({\r\n icon: Ti.UI.Windows.SystemIcon.BACK\r\n });\r\n\r\n backViaWinButton.addEventListener('click', function () {\r\n win.close();\r\n });\r\n\r\n var backViaTabButton = Ti.UI.Windows.createAppBarButton({\r\n icon: Ti.UI.Windows.SystemIcon.BACKTOWINDOW\r\n });\r\n\r\n backViaTabButton.addEventListener('click', function () {\r\n tabA.close(win);\r\n });\r\n\r\n win.add(Ti.UI.Windows.createCommandBar({\r\n items: [backViaWinButton, backViaTabButton]\r\n }));\r\n }\r\n\r\n return win;\r\n}\r\n\r\nvar tabA = Ti.UI.createTab({\r\n title: 'Tab A',\r\n window: createWindow(0)\r\n});\r\n\r\nvar tabB = Ti.UI.createTab({\r\n title: 'Tab B',\r\n window: Ti.UI.createWindow({\r\n backgroundColor: 'green'\r\n })\r\n});\r\n\r\nTi.UI.createTabGroup({\r\n tabs: [tabA, tabB]\r\n}).open();\r\n{code}", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-12T15:39:19.000+0000", "updated": "2016-05-12T15:39:19.000+0000" }, { "id": "385578", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed.\r\n\r\nTested on:\r\nNokia Lumia 928 (8.1) \r\nWindows Simulator (8.1) \r\nMicrosoft Lumia 640 (10) \r\nWindows Simulator (10)\r\nWindows 10 \r\nStudio: 4.6.0.201605121040\r\nTi SDK: 5.3.0.v20160512105713\r\nAppc NPM: 4.2.5-5 \r\nApp CLI: 5.3.0-44 \r\nNode v0.12.7\r\n\r\n*Closing Ticket.*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-12T20:59:26.000+0000", "updated": "2016-05-12T20:59:26.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }