{ "id": "86372", "key": "AC-2891", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-14T14:48:58.000+0000", "created": "2012-02-11T11:29:09.000+0000", "labels": [ "android", "custom", "fireevent", "module", "webview" ], "versions": [], "issuelinks": [], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:47:51.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": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "In Android, a webview can can call Titanium.App.fireEvent just fine UNLESS you have a custom module in your project. Once you call a custom module with the require() syntax, all webview fireEvent calls fail. See the complete example below (you'll need to add your own custom module):\r\n \r\n\r\n// if you uncomment the external module line below, webview can no longer call fireEvent!\r\n//var SQLOBJ = require(\"com.dmarie.sql\");\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nTitanium.App.addEventListener(\"testEvent\",function(e){\r\n\tTitanium.API.info(\"****testEvent fired...\");\r\n\talert(\"it works:\" + e.obj);\r\n})\r\nvar webview = Titanium.UI.createWebView({\r\n\thtml : \"\"+\r\n\t\t\t\"

webview

\"\r\n});\r\nwin.add(webview);\r\n\r\nwin.open();\r\n\r\n", "attachment": [ { "id": "25741", "filename": "app.js", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-11T11:29:09.000+0000", "size": 654, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android Webview fireEvent doesn't work if a custom module is included in the project", "creator": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.2, Titanium SDK 1.8.x", "comment": { "comments": [ { "id": "182917", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This only happens with our module (com.dmarie.sql) which uses a lot of native .c code and the NDK.\r\n\r\nAlso of note, is that if the require(\"com.dmarie.sql\") is moved AFTER the win.open() call, the bug does not occur.\r\n\r\nThird, after require(\"com.dmarie.sql\") is called, all webview objects have the problem. Even if those webviews are in other windows, or declared in a separate commonJS module.", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-13T09:38:49.000+0000", "updated": "2012-02-13T09:38:49.000+0000" }, { "id": "183101", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The problem was in the custom module.\r\n\r\nCreating a new instance of AppModule caused the problem:\r\nmodule = new AppModule()\r\n\r\nInstead, we changed this reference to:\r\nAppModule app = (AppModule)TiApplication.getInstance().getModuleByName(\"App\");\r\n\r\nThis problem is now resolved.", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-14T14:42:13.000+0000", "updated": "2012-02-14T14:42:13.000+0000" }, { "id": "183102", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed resolved by reporter and no further action required from our end.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-14T14:48:58.000+0000", "updated": "2012-02-14T14:48:58.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }