{ "id": "63273", "key": "TIMOB-2641", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11251", "name": "Sprint 2011-16", "archived": true, "released": true, "releaseDate": "2011-04-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-11T14:54:50.000+0000", "created": "2011-04-15T03:25:36.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "fireevent", "ios", "klist", "webview" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-11T14:54:50.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}

I encounter some weird behavior and found there was a previous\nissue concerning WebView.url(newUrl).

\n

When I call WebView.reload() after a screen rotation (else the\nWebView doesn't resize it's content) then the connection is\nbroken.

\n

More info about what happens:

\n
\n    function openDocument(docURL) {
\n
\n\n\n
\n
\n
\n    alert('webview click received // ' + docURL);\n    Ti.App.fireEvent('customOpenDocument', {url:docURL});\n    alert('webview click received CALL ENDED');\n};</code>\n
\n
\n\n\n
\n
\nThe first alert shows up. But I never receive the fired event, and\nthe 2nd alert doesn't show up. However I no reload() was previously\ncalled, then the event is received and the 2nd alert show.\n

SDK 1.5.1 / iPad

{html}", "attachment": [ { "id": "18181", "filename": "archive.zip", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:36.000+0000", "size": 1203, "mimeType": "application/zip" } ], "flagged": false, "summary": "WebView.reload() breaks fireEvent/listener connection ", "creator": { "name": "jérémyr", "key": "jérémyr", "displayName": "Jérémy R", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jérémyr", "key": "jérémyr", "displayName": "Jérémy R", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129058", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

fireEvent is lost after webview.reload(); is called. Event fires\nonce and and as soon as webview is reloaded event is los

\n

Ticket Reference and testing code: http://developer.appcelerator.com/helpdesk/view/72421

\n

Simple Testing Code attached.

{html}", "updateAuthor": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:36.000+0000", "updated": "2011-04-15T03:25:36.000+0000" }, { "id": "129059", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm confused here. You're calling reload(), which loads the page\nup as if it were completely fresh and new (Akin to hitting reload\non a web browser). By definition, the state of the web view will be\nlost because it's reloading.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:37.000+0000", "updated": "2011-04-15T03:25:37.000+0000" }, { "id": "129060", "author": { "name": "jérémyr", "key": "jérémyr", "displayName": "Jérémy R", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The fact is that the listener doesn't (in application) does not\nreceive an event which is fired from a webview that have been\nreload.
\nIt has to re-register itself as a listener.

{html}", "updateAuthor": { "name": "jérémyr", "key": "jérémyr", "displayName": "Jérémy R", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:37.000+0000", "updated": "2011-04-15T03:25:37.000+0000" }, { "id": "129061", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Let's investigate this further. There appears to be a\nworkaround, but perhaps we could do more for our customer.

{html}", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:37.000+0000", "updated": "2011-04-15T03:25:37.000+0000" }, { "id": "129062", "author": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Reggie: what is the workaround exactly?

{html}", "updateAuthor": { "name": "johnjohnson", "key": "johnjohnson", "displayName": "John Johnson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:25:38.000+0000", "updated": "2011-04-15T03:25:38.000+0000" }, { "id": "132689", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The workaround was simply setting the url or html again. The native web view reload wasn't giving us time to do the injection. It's fixed now.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-25T10:41:02.000+0000", "updated": "2011-04-25T10:41:02.000+0000" }, { "id": "133439", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No longer able to reproduce with iPhone 4, iOS 4.3.3. KS 1.7.0, build 1.7.0.879871b. Closing\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-11T14:54:50.000+0000", "updated": "2011-05-11T14:54:50.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }