{ "id": "93365", "key": "TIMOB-9593", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15079", "description": "2013 Sprint 02 API", "name": "2013 Sprint 02 API", "archived": true, "released": true, "releaseDate": "2013-01-28" }, { "id": "14812", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" }, { "id": "15273", "description": "2013 Sprint 05 API", "name": "2013 Sprint 05 API", "archived": true, "released": true, "releaseDate": "2013-03-11" }, { "id": "14815", "description": "2013 Sprint 05", "name": "2013 Sprint 05", "archived": true, "released": true, "releaseDate": "2013-03-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-26T10:32:11.000+0000", "created": "2012-06-17T01:48:06.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_webview", "qe-and060112", "qe-testadded", "regression" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [ { "id": "25952", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "109656", "key": "TIMOB-13059", "fields": { "summary": "Android: WebView: remove requirement to set baseURL", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "26343", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "110351", "key": "TIMOB-13145", "fields": { "summary": "iOS: Setting WebView HTML contents directly fails to load local JavaScript file on device", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-03-27T10:54:59.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": "A webview with HTML property (containing the HTML content of the webview) loads successfully but does not reload.\r\n\r\nThe behavior occurs since 2.0.1. This worked fine on 1.8.2\r\n\r\nSteps to reproduce:\r\n1. Create an application with code below\r\n2. Launch app on android device\r\n3. Click on \"Remove and release and add webview\" button\r\n\r\nActual: After step 2, the webview launches successfully\r\nAfter step 3, the webview does not reload\r\n\r\nExpected: The webview with HTML content should reload.\r\n\r\n{code}\r\nvar _window = Ti.UI.createWindow({\r\n\tbackgroundColor:'#000'\r\n})\r\n \t\tvar webview=Ti.UI.createWebView({\r\n\t\t\t//url:'http://www.google.com',\r\n\t\t\thtml:'test',\r\n\t\t\ttop : 0,\r\n\t\t\theight : 200\r\n\t\t});\r\n\t\t\r\n\t\twebview.addEventListener('load', function() {\r\n\t\t\talert('The webview is loaded!');\r\n\t\t});\r\n\r\n\t\tvar b2 = Ti.UI.createButton({\r\n\t\t\ttitle : \"remove and release and add webview\",\r\n\t\t\ttop : 280\r\n\t\t});\r\n\t\tb2.addEventListener(\"click\", function() {\r\n\t\t\t_window.remove(webview);\r\n\t\t\twebview.reload();\r\n\t\t\t_window.add(webview);\r\n\t\t});\r\n\r\n_window.add(webview);\r\n_window.add(b2);\r\n_window.open();\r\n{code}", "attachment": [ { "id": "35767", "filename": "app.js", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:02:05.000+0000", "size": 2809, "mimeType": "text/javascript" }, { "id": "35768", "filename": "test.html", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:02:05.000+0000", "size": 173, "mimeType": "text/html" }, { "id": "35769", "filename": "test2.html", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:02:05.000+0000", "size": 171, "mimeType": "text/html" }, { "id": "35770", "filename": "webview.html", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:02:05.000+0000", "size": 192, "mimeType": "text/html" } ], "flagged": false, "summary": "Android: Webview: Webview with HTML property having HTML content does not reload", "creator": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [ { "id": "108668", "key": "TIMOB-12455", "fields": { "summary": "Backport to 3_0_X: TIMOB-9593", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio: 2.1.0.201206151953\r\nTitanium SDK: 2.1.0.v20120615184153\r\nAndroid Device: Android Emulator 2.2, Android Tab (V3.2), Galaxy Nexus (V4.0.2)\r\nRuntime: v8", "comment": { "comments": [ { "id": "198851", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-17T16:12:36.000+0000", "updated": "2012-06-17T16:12:36.000+0000" }, { "id": "232306", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue still occurs. Tested on 3.0.0.GA.\nThe issue is same as TIMOB-3501 which was reported for both url and html property of webview. However the url property works fine now and the issue exists only for html property.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-21T06:15:22.000+0000", "updated": "2012-12-21T06:15:22.000+0000" }, { "id": "235827", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending\r\nhttps://github.com/appcelerator/titanium_mobile/pull/3782", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T00:55:19.000+0000", "updated": "2013-01-25T00:55:19.000+0000" }, { "id": "235979", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another test case:\nPut flower.jpg in /Resources/ .\n{code}\nvar _window = Ti.UI.createWindow({\n\tbackgroundColor : '#000'\n})\n\nvar html = '\"flower\"';\n\nvar webview = Ti.UI.createWebView({\n\thtml: html,\n\ttop : 0,\n\theight : 200\n});\n\nwebview.addEventListener('load', function() {\n\talert('The webview is loaded!');\n});\n\nvar b2 = Ti.UI.createButton({\n\ttitle : \"remove and release and add webview\",\n\ttop : 280\n});\nb2.addEventListener(\"click\", function() {\n\t_window.remove(webview);\n\twebview.reload();\n\t_window.add(webview);\n});\n\n_window.add(webview);\n_window.add(b2);\n_window.open(); \n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T19:59:27.000+0000", "updated": "2013-01-25T19:59:27.000+0000" }, { "id": "236034", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Bad test case. If this code is in base Resources/ folder it might work. What if this code is in a file that is in a subfolder of Resources? ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T22:53:43.000+0000", "updated": "2013-01-25T22:53:43.000+0000" }, { "id": "236235", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport PR https://github.com/appcelerator/titanium_mobile/pull/3805", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-28T17:56:01.000+0000", "updated": "2013-01-28T17:56:01.000+0000" }, { "id": "236409", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Webview is reloading successfully now.\r\nTitanium SDK: 3.1.0.v20130128172329\r\nTitanium SDK: 3.0.2.v20130128174806\r\nTitanium  Studio:3.0.2.201301251115\r\nDevice: Samung GALAXY Tab 620 Android 3.2, Samsung GALAXY Note\tAndroid 2.3.6\r\n", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-29T10:45:11.000+0000", "updated": "2013-01-29T10:45:11.000+0000" }, { "id": "238333", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The fix for this resulted in a slight change with regards to needing a base URL:\n\nFormerly:\n{code}\nvar win = Titanium.UI.createWindow({\nbackgroundColor:'#fff'\n});\n\nwin.add(Titanium.UI.createWebView({\nheight:Ti.UI.FILL,\nwidth:Ti.UI.FILL,\nhtml:\"

hello

\"\n}));\n\nwin.open();\n{code}\n\n\nNow, the behavior is like so (note the addition of baseURL):\n\n{code}\nvar win = Titanium.UI.createWindow({\nbackgroundColor:'#fff'\n});\n\nvar webview = Titanium.UI.createWebView({\nheight:Ti.UI.FILL,\nwidth:Ti.UI.FILL\n});\n\nwin.add(webview);\nwebview.setHtml(\"

hello

\", {baseURL:'file:///android_asset/Resources/'});\nwin.open();\n{code}", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-13T15:31:12.000+0000", "updated": "2013-02-13T15:31:12.000+0000" }, { "id": "239315", "author": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "body": "I think Ping Wang's test case with flower.jpg is a valid test case because the documentation for WebView at http://docs.appcelerator.com/titanium/3.0/#!/guide/The_WebView_Component-section-29004918_TheWebViewComponent-UsingLocalWebContentwithWebView declares that \"{{all local web content is available relative to your project's Resources directory}}\" as below:\r\n\r\nbq.Let's say you not only want to show a local HTML file, but you also want that HTML file to have access to local CSS and Javascript files. All you need to do is remember that all local web content is available relative to your project's Resources directory. You can think of Resources almost as a local web server root path. To illustrate this point, let's take the prior example and expand it to use local CSS and Javascript files. \r\n\r\nSo many developers are going to expect the the URLs for any local resource files will be relative to the Resources directory by default. Having to add a special {{{baseURL:'file:///android_asset/Resources/'}}} for Android breaks that supposed rule.\r\n\r\nHaving to use a {{baseURL}} option is fine but it should be clarified in the documentation or some other appropriate location because this will break existing code that used the assumption from the documentation that all local resources are relative to your Resources directory of your project. For example my project worked great until 3.0.2, at which point none of my local Android resource files were being loaded correctly until I came across this workaround. ", "updateAuthor": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "created": "2013-02-21T21:10:43.000+0000", "updated": "2013-02-21T21:10:43.000+0000" }, { "id": "239757", "author": { "name": "azwan082", "key": "azwan082", "displayName": "Azwan b. Amit", "active": true, "timeZone": "Asia/Shanghai" }, "body": "What is the supposed value for baseURL above for iOS? this breaking change cause my app to stop working until I found this bug report. Also, even with baseURL specified, I couldn't fireEvent to and from webview and js module.", "updateAuthor": { "name": "azwan082", "key": "azwan082", "displayName": "Azwan b. Amit", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2013-02-26T03:06:28.000+0000", "updated": "2013-02-26T03:06:28.000+0000" }, { "id": "239814", "author": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "body": "@Azwan this bug is only for Android, so you only need to set the {{baseURL}} for Android. In my app, for iOS, I simply don't specify any {{baseURL}} and the files load correctly, as expected. I cannot verify your problems with firing events to and from the webview and the local js; for me it all works fine in both Android and iOS once I've set the {{baseURL}} for Android. I fire an event from the local JS loaded by the webview component, and I can receive that event in my application code. I have not yet tried firing an event from my Titanium code and receiving it in the local webview component.", "updateAuthor": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "created": "2013-02-26T17:53:12.000+0000", "updated": "2013-02-26T17:53:12.000+0000" }, { "id": "239881", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening to fix the reload method and fix the baseURL problems", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:01:08.000+0000", "updated": "2013-02-26T23:01:08.000+0000" }, { "id": "239882", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resources for test case", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:02:05.000+0000", "updated": "2013-02-26T23:02:05.000+0000" }, { "id": "239884", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/3909", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T23:03:04.000+0000", "updated": "2013-02-26T23:03:04.000+0000" }, { "id": "241726", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTitanium SDK: 3.1.0.v20130311192922\r\nTitanium  Studio:3.0.2.201302151605\r\nDevice: Samsung GALAXY Note (2.3.6) and Samung GALAXY Tab 620 Android 3.2", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-12T10:49:04.000+0000", "updated": "2013-03-12T10:49:04.000+0000" }, { "id": "263380", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update label.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T10:28:30.000+0000", "updated": "2013-07-26T10:28:30.000+0000" }, { "id": "263381", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "updated label.\r\nClosing as Fixed.\r\n\r\nVerified with environment:\r\n\r\nStudio: 3.1.1.201306131423\r\nSDK: 3.1.2.v20130725180746\r\nacs:1.0.3\r\nalloy:1.1.3\r\nnpm:1.2.14\r\ntitanium:3.1.1\r\ntitanium-code-processor:1.0.1\r\nOS: OSX 10.8\r\nDevice: HTC Desire(v4.0.3),iphone simulator(v6.0)\r\n\r\n\r\nWebview with HTML property having HTML content getting reload now.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T10:32:11.000+0000", "updated": "2013-07-26T10:32:11.000+0000" }, { "id": "298942", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-03-27T10:54:59.000+0000", "updated": "2014-03-27T10:54:59.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }