{ "id": "115826", "key": "TIMOB-14207", "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": "15118", "description": "2013 Sprint 13 BB", "name": "2013 Sprint 13 BB", "archived": true, "released": true, "releaseDate": "2013-07-01" }, { "id": "15111", "description": "2013 Sprint 13", "name": "2013 Sprint 13", "archived": true, "released": true, "releaseDate": "2013-07-01" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-12-18T00:16:41.000+0000", "created": "2013-06-12T15:26:15.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Blackberry", "events", "qe-closed-3.2.0", "qe-testadded", "ti.app", "webview" ], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-12-18T06:51:39.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "*Problem*\r\nIn a local webview any titanium functionality such as\r\n{code:javascript}Ti.API.info('hello world');{code}\r\nor more important than that\r\n{code:javascript}Ti.API.addEventListener/fireEvent{code}\r\ndo not work.\r\n\r\nI have also tried placing them in a timeout like mobile web but to no avail: Ti is always undefined.\r\n\r\n*index.xml*\r\n{code:xml}\r\n\r\n\t\r\n\r\n{code}\r\n\r\n*index.js*\r\n{code:javascript}\r\nif (Ti.Platform.name === 'blackberry'){\r\n $.mainWebView.url = 'local:///assets/www/index.html';\r\n}\r\n{code}\r\n\r\n*index.html*\r\n{code:html}\r\n\r\n\r\n\t\r\n\t\r\n\r\n\tSomePage\r\n\t\r\n\t\r\n\t\r\n\t\r\n \r\n \r\n\t\r\n\t\r\n\r\n\r\n\r\n\r\n{code}", "attachment": [ { "id": "41543", "filename": "webview_test.zip", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-12T22:22:30.000+0000", "size": 1306, "mimeType": "application/zip" } ], "flagged": false, "summary": "BlackBerry: Local WebView - Ti is undefined", "creator": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK : 3.2.0\r\nStudio : 3.1.1\r\nBlackberry 10 sim", "comment": { "comments": [ { "id": "257564", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can we get a snippet of offending code? Ti.API.info is available but I'm not sure what in web view means.", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-13T05:52:47.000+0000", "updated": "2013-06-13T05:52:47.000+0000" }, { "id": "257574", "author": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "body": "index.xml has the following:\n\n\n\t\n\n\nsince /www/index.html somehow in blackberry cannot be found for the webview's url, in index.js a condition is done checking the platform \n\nif(Ti.Platform.name ==='blackberry'){\n $.mainWebView.url = 'local:///assets/www/index.html';\n}\n\n\nindex.html has the following code:\n\n\n\n\t\n\t\n\n\tSomePage\n\t\n\t\n\t\n\t\n \n \n\t\n\t\n\n\n\t\n\n\n", "updateAuthor": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-13T07:21:28.000+0000", "updated": "2013-06-13T07:21:28.000+0000" }, { "id": "257587", "author": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "body": "looking at the blackberry documentation and the github Tiblackberry repository, I think this is still missing for two way interaction between the webview and the app on titanium.\n\n\"You can interact with JavaScript executing on the page by using postMessage() and connecting to the messageReceived() signal. JavaScript can communicate back by using the \"navigator.cascades.postMessage()\" function and storing a message handler in the \"navigator.cascades.onmessage\" property.\" (http://developer.blackberry.com/cascades/reference/bb__cascades__webview.html)", "updateAuthor": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-13T10:26:24.000+0000", "updated": "2013-06-13T10:26:24.000+0000" }, { "id": "257595", "author": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "body": "Based on the android binding.js, I've added the following gist that needs to be injected on a local webview: https://gist.github.com/anonymous/5772986 .Obviously the interface between the titanium app has to be added. Note that in that gist the logging part has been left our (in Android it is through the webviews addJavascriptInterface )", "updateAuthor": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-13T11:29:03.000+0000", "updated": "2013-06-13T11:29:03.000+0000" }, { "id": "258466", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks Michael, I'm working on this. ", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-18T22:26:56.000+0000", "updated": "2013-06-18T22:26:56.000+0000" }, { "id": "258586", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/111", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-19T18:53:44.000+0000", "updated": "2013-06-19T18:53:44.000+0000" }, { "id": "259866", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Nice.", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-27T19:12:07.000+0000", "updated": "2013-06-27T19:12:07.000+0000" }, { "id": "259965", "author": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "body": "thanks! ", "updateAuthor": { "name": "michael@webitstudios.com", "key": "michael@webitstudios.com", "displayName": "Michael DeGiovanni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-28T07:02:34.000+0000", "updated": "2013-06-28T07:02:34.000+0000" }, { "id": "266079", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Attached sample code", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-12T22:22:30.000+0000", "updated": "2013-08-12T22:22:30.000+0000" }, { "id": "266092", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix & the fix works as expected.Thus closing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.1.2.201308082014\r\nTi SDK : 3.1.2.v20130809141556\r\nMac OSX : 10.8.4\r\nAlloy : 1.2.0-alpha6\r\nCLI - 3.1.2-alpha\r\nwin 7 \r\nWin 8 \r\nZ10 BB simulator : 10.0.10.822\r\nZ10 device running 10.0.10.88\r\n\r\nQ10 Simulator : 10.1.0.1720\r\nQ10 Dev alpha C device running 10.1.0.138", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-12T22:53:40.000+0000", "updated": "2013-08-12T22:53:40.000+0000" }, { "id": "284798", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~penrique] \nAppcelerator Studio, build: 3.2.0.201312162210\nTitanium SDK, build: 3.2.0.v20131216191854\nCLI 3.2.0-cr3\nAlloy 1.3.0-cr2\nBBZ10 10.1.0\n\nTested .zip and webview header value \"something else\" does not change to \"am changed again\" as per code.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T18:36:53.000+0000", "updated": "2013-12-17T18:36:53.000+0000" }, { "id": "284902", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Cause was due to a change in the Ti.App module.\r\n\r\nPR for master: https://github.com/appcelerator/titanium_mobile_blackberry/pull/199\r\nPR for 3.2.x: https://github.com/appcelerator/titanium_mobile_blackberry/pull/200", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T23:13:49.000+0000", "updated": "2013-12-17T23:13:49.000+0000" }, { "id": "284984", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested Environment:\r\n\r\nAppcelerator Studio: 3.2.0.201312171913\r\nSDK:3.2.0.v20131217190633\r\nalloy: 1.3.0-cr2\r\nacs: 1.0.10\r\nnpm: 1.3.2\r\ntitanium: 3.2.0-cr3\r\ntitanium-code-processor: 1.1.0-cr2\r\nOS: Mac OSX 10.9\r\nBlackberry Z10(v 10.0.10.261)\r\n\r\n\r\nUsed with the sample code attached.\r\n\r\nGot the expected result as per code.\r\n\r\n1)Clicking on 'click here' button. Webview header with id header_2 changes its title as 'something else' and also button with having title 'fire event' also changes to 'something else'. Console also gets logged printed with \"Hello World!\"\r\n\r\n2)Then on clicking 'something else' title button. Again the Webview header with id header_2 changes its title as 'prop_1' \r\n\r\nHence closing the issue as working fine.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-18T06:51:39.000+0000", "updated": "2013-12-18T06:51:39.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }