[TIMOB-16942] BlackBerry: FireEvent on webview is not working
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-05-22T18:04:36.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | n/a |
Components | BlackBerry |
Labels | look1, qe-3.3.0 |
Reporter | Priya Agarwal |
Assignee | Pedro Enrique |
Created | 2014-05-09T11:12:08.000+0000 |
Updated | 2017-03-16T20:22:08.000+0000 |
Description
Steps to reproduce:
1. Copy paste the code in classic Project and run the app.
2. Click on WebView.
Actual Result:
Getting only One alert.
alert 1: click event received
Expected Result:
Two alerts must be fired.
alert 1: click event received
alert 2: WebView received appClicked event
But Fire Event is working properly on both iOS and Android platforms
app.js
var win = Ti.UI.createWindow({
backgroundColor : 'black'
});
var webview = Ti.UI.createWebView({
url : "test.html"
});
webview.addEventListener("click", function() {
alert("click event received");
Ti.App.fireEvent("appClicked");
});
win.add(webview);
win.open();
test.html
<html>
<head>
<title>Test for textfields</title>
<script type="text/javascript">
Ti.App.addEventListener("appClicked", function(_event) {
alert("WebView received appClicked event");
});
</script>
</head>
<body>
Testing fire event
</body>
</html>
For the web view to be able to receive and send events, it first needs to load the page and then wait a bit for the injection of the internal Ti javascript. Replace the JS in the html file with this:
Closing ticket as BlackBerry is no longer supported by us.