{ "id": "64133", "key": "TIMOB-3501", "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": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T18:55:44.000+0000", "created": "2011-04-15T03:45:57.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "reported-1.6.1" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-09T18:55:44.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
Testing using:
\nThe following code demonstrates that webview.reload() does not\nreload the url
or html
properties. Hence,\nalthough all the other webview properties are retained (ie, width,\nheight, backgroundColor etc), the contents of the webview must be\nmanually reloaded. This workaround is included in the code, where\neither the url
or html
properties are\nreassigned:
app.js:
\n\nvar win = Ti.UI.createWindow();\n\nvar thisHTML = \"<html><body><button onClick=\\\"Ti.App.fireEvent(\\'alert\\');\\\">Click me to fire an alert</button><button onClick=\\\"Ti.App.fireEvent(\\'reload\\');\\\">Click me to reload webview</button></body></html>\";\n\nvar webview = Ti.UI.createWebView({\n backgroundColor:\"red\",\n url:\"webview.html\", // contents will not be reloaded on webview.reload()\n// html:thisHTML, // this will also exhibit the problem when webview.reload() is used\n height:300,\n width:300\n});\n \nTi.App.addEventListener(\"reload\", function(){\n Ti.API.info(\"Reloaded Webview\");\n alert(\"fireEvent from webview - reload Webview\");\n webview.reload();\n// webview.url = \"webview.html\"; // this can be used as a workaround\n// webview.html = thisHTML; // this can be used as a workaround\n});\n \nTi.App.addEventListener(\"alert\", function(){\n Ti.API.info(\"fireEvent from webview - alert\");\n alert(\"Alert was Clicked.\");\n});\n\nwin.add(webview);\nwin.open();
\n
\nwebview.html:
\n\n<html>\n<body>\n<button onClick=\"Ti.App.fireEvent('alert');\">Click me to fire an alert</button>\n<button onClick=\"Ti.App.fireEvent('reload');\">Click me to reload webview</button>\n</body>\n</html>
\n
Note: the url case should be supported. Not sure it's worth\ntrying to keep an unmodified version of the html source around.