[TIMOB-3501] webview reload() does not reload `url` or `html `properties
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T18:55:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, defect, reported-1.6.1 |
Reporter | Paul Dowsett |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:45:57.000+0000 |
Updated | 2020-01-09T18:55:44.000+0000 |
Description
Testing using:
- Titanium Mobile SDK 1.6.1(15 Mar 2011)
- Android emulator 2.2
The following code demonstrates that webview.reload() does not
reload the url
or html
properties. Hence,
although all the other webview properties are retained (ie, width,
height, backgroundColor etc), the contents of the webview must be
manually reloaded. This workaround is included in the code, where
either the url
or html
properties are
reassigned:
app.js:
var win = Ti.UI.createWindow();
var 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>";
var webview = Ti.UI.createWebView({
backgroundColor:"red",
url:"webview.html", // contents will not be reloaded on webview.reload()
// html:thisHTML, // this will also exhibit the problem when webview.reload() is used
height:300,
width:300
});
Ti.App.addEventListener("reload", function(){
Ti.API.info("Reloaded Webview");
alert("fireEvent from webview - reload Webview");
webview.reload();
// webview.url = "webview.html"; // this can be used as a workaround
// webview.html = thisHTML; // this can be used as a workaround
});
Ti.App.addEventListener("alert", function(){
Ti.API.info("fireEvent from webview - alert");
alert("Alert was Clicked.");
});
win.add(webview);
win.open();
webview.html:
<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>
Note: the url case should be supported. Not sure it's worth trying to keep an unmodified version of the html source around.
Neither reload() works nor repaint() on iPhone?
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.