{ "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

\n

Please see the following code: http://pastie.org/1755281

\n

iOS SDK 4.2, Titanium SDK 1.6.1, Xcode 3.2.5, tested on both the\nsimulator and physical device

\n

I'm trying to create a window that implements a webview with a\npageflipper.

\n

My 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.

\n

I think it has something to do with the webview doing a reload()\nwhen the window is opening again, which breaks the listener\nconnection (#2641).

\n

My 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.

\n

Thank you.

{html}", "attachment": [], "flagged": false, "summary": "Re-opening a window breaks all event handlers (iOS)", "creator": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "130725", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

\n

Note the issue does not exist on Android Ti 1.6.1,\nAndroid 2.2.

\n

As the code is short, I've pasted it below (errors fixed):

\n

app.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
\n

win2.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
\n

webview.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
{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:46:02.000+0000", "updated": "2011-04-15T03:46:02.000+0000" }, { "id": "130726", "author": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi hal,

\n

I've updated my ticket to reflect my environment. Is it possible\nto create a workaround or is it indeed a bug?

{html}", "updateAuthor": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:46:02.000+0000", "updated": "2011-04-15T03:46:02.000+0000" }, { "id": "130727", "author": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Anything new?

{html}", "updateAuthor": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:46:02.000+0000", "updated": "2011-04-15T03:46:02.000+0000" }, { "id": "421329", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T22:57:21.000+0000", "updated": "2017-06-07T22:57:21.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }