{ "id": "64137", "key": "TIMOB-3505", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-07T22:57:21.000+0000", "created": "2011-04-15T03:46:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-07T22:57:21.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": "{html}
Hi
\nPlease see the following code: http://pastie.org/1755281
\niOS SDK 4.2, Titanium SDK 1.6.1, Xcode 3.2.5, tested on both the\nsimulator and physical device
\nI'm trying to create a window that implements a webview with a\npageflipper.
\nMy pageflipper fires some custom events using Ti.App.fireEvent(\n'nextPage' ); etc., which works amazingly well.
\n... until I close the window and try to open the window again.\nNow, my custom events don't get fired. This happens randomly.\nSometimes it works the first time, second time, not the third time\netc. It always works the first time though.
\nI think it has something to do with the webview doing a reload()\nwhen the window is opening again, which breaks the listener\nconnection (#2641).
\nMy app is ready to be submitted to the App Store but this bug is\nstalling me. I really need this to be fixed ASAP with some kind of\nworkaround.
\nThank you.
John - please state your environment - what Ti / iOS SDK / XCode\nversions are you using? Have you tested it in the simulator and/or\na physical device? Please amend your ticket, adding this\ninformation.
\nNote the issue does not exist on Android Ti 1.6.1,\nAndroid 2.2.
\nAs the code is short, I've pasted it below (errors fixed):
\napp.js:
\n\nvar win = Ti.UI.createWindow({backgroundColor:\"white\"});\n\nvar label = Ti.UI.createLabel({\n text: 'Click me',\n color: '#fff',\n width: 'auto',\n height: 'auto'\n});\n\nlabel.addEventListener( 'click', function() {\n\n var win2 = Ti.UI.createWindow({\n url: 'win2.js',\n zIndex: 2,\n backgroundColor: '#000'\n });\n\n win2.open({\n modal: true\n }); \n\n});\n\nwin.add( label );\nwin.open();
\n
\nwin2.js:
\n\nvar webview = Ti.UI.createWebView({\n url:\"webview.html\"\n});\n\nTi.App.addEventListener(\"close\", function(){\n Ti.UI.currentWindow.close();\n});\n\nTi.UI.currentWindow.add( webview );
\n
\nwebview.html:
\n\n<html>\n<body>\n<button onClick=\"Ti.App.fireEvent('close');\">Click me to close the window</button>\n</body>\n</html>
\n
Hi hal,
\nI've updated my ticket to reflect my environment. Is it possible\nto create a workaround or is it indeed a bug?
Anything new?