{ "id": "110110", "key": "TIMOB-12883", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15097", "description": "2013 Sprint 05 BB", "name": "2013 Sprint 05 BB", "archived": true, "released": true, "releaseDate": "2013-03-11" }, { "id": "14815", "description": "2013 Sprint 05", "name": "2013 Sprint 05", "archived": true, "released": true, "releaseDate": "2013-03-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-02-27T05:48:20.000+0000", "created": "2013-02-25T11:03:12.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "blackberry", "module_window", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-24T09:44:11.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "h2. Problem\r\nWhen closing a child window with Ti.UI.Window.close(), the whole application get closed.\r\n\r\nh3. actual behavior\r\napplication close\r\n\r\nh3. expected behavior\r\nclose child window only\r\n\r\nh2. Test case\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow();\r\n\r\nfunction initWebViewWindow(url, timeout) {\r\n var self = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n });\r\n\r\n var view = Ti.UI.createView({\r\n top : '90%',\r\n left : 0,\r\n height : '10%',\r\n backgroundColor : '#08A7DC'\r\n });\r\n\r\n var backView = Ti.UI.createView({\r\n left : 0,\r\n top : 0,\r\n width : '100%',\r\n bottom : 0\r\n });\r\n\r\n var backLabel = Ti.UI.createLabel({\r\n top : 4,\r\n left : 10,\r\n right : 0,\r\n bottom : 0,\r\n text : 'Back',\r\n color : 'white',\r\n font : {\r\n fontSize : 16,\r\n fontFamily : 'Helvetica Neue'\r\n },\r\n textAlign : 'center',\r\n touchEnabled : false\r\n });\r\n\r\n backView.add(backLabel);\r\n view.add(backView);\r\n\r\n backView.addEventListener(\"click\", function(e) {\r\n Ti.API.info('-------------------> backView click');\r\n self.close(); // <<<<==== This accidentially closes the whole Application!!!\r\n });\r\n\r\n self.add(view);\r\n\r\n var webview = Ti.UI.createWebView({\r\n top : 0,\r\n left : 0,\r\n right : 0,\r\n height : '90%',\r\n url : url\r\n });\r\n\r\n // TODO: timeout not there yet\r\n // webview.setTimeout(timeout);\r\n\r\n webview.addEventListener('load', function(e) {\r\n Ti.API.info('-------------------> webview load');\r\n Ti.API.info(e);\r\n });\r\n\r\n webview.addEventListener('beforeload', function(e) {\r\n Ti.API.info('-------------------> webview beforeload');\r\n Ti.API.info(e);\r\n });\r\n\r\n webview.addEventListener('error', function(e) {\r\n Ti.API.info('-------------------> webview error');\r\n Ti.API.info(e);\r\n });\r\n\r\n self.add(webview)\r\n return self;\r\n\r\n}\r\n\r\nvar button = Ti.UI.createButton({\r\n title : 'open WebView Window'\r\n});\r\n\r\nbutton.addEventListener('click', function(e) {\r\n var webViewWindow = initWebViewWindow('http://www.google.com', 5000);\r\n webViewWindow.open();\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code} \r\n\r\nh2. Discussions\r\nLink to [Google Groups: Appc Ti Mobile BlackBerry|https://groups.google.com/forum/?fromgroups=#!topic/appc-ti-mobile-blackberry/SJ1bqFyk88w]\r\n", "attachment": [], "flagged": false, "summary": "BlackBerry: closing a child window with Ti.UI.Window.close() closes the application", "creator": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Mac OS X 10.7.5\r\nTitanium Studio, build: 3.1.0.201302221817\r\nmobilesdk-3.1.0.v20130221174202-osx\r\nBlackBerry 10 Dev Alpha Simulator BB10_0_10.261\r\nBlackBerry 10 Dev Alpha B, Software Release: 10.9.10.35\r\n", "comment": { "comments": [ { "id": "239902", "author": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "body": "Is there any workaround I can use instead of self.close() ?\n\nThis Bug is really a showstopper for me now.\n\nThank you very much.", "updateAuthor": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-02-26T23:51:13.000+0000", "updated": "2013-02-26T23:51:13.000+0000" }, { "id": "239938", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It looks like the application is crashing when close is called on the window.\nDebugging now and will try to get a fix once I have found a solution.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-27T01:41:29.000+0000", "updated": "2013-02-27T01:41:29.000+0000" }, { "id": "239982", "author": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "body": "Josh, thank you very much for the quick response.\r\nI tested with mobilesdk-3.1.0.v20130226221017-osx and it works as expected. ", "updateAuthor": { "name": "mkroeger", "key": "mkroeger", "displayName": "Matthias Kroeger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-02-27T10:00:19.000+0000", "updated": "2013-02-27T10:00:19.000+0000" }, { "id": "240034", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the issue & working as expected.Thus closing.\r\n\r\nEnvironment:\r\nTi Studio : 3.1.0.201302221817\r\nTi BB SDK : 3.1.0.v20130227112907\r\nMac OSX : 10.8.2\r\nwin 7 \r\nWin 8 \r\nBB simulator : 10.0.10.261\r\nDev alpha B 10 device", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-27T20:08:49.000+0000", "updated": "2013-02-27T20:08:49.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }