{ "id": "113278", "key": "TIMOB-13662", "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": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-06-01T23:15:12.000+0000", "created": "2013-04-23T12:17:43.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T21:51:44.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Problem description*\r\nI have a webview that on start up is empty on an iOS as it acts to show detail. So I used the html property to effectively set a default blank page. It seems that setting this property stops setUrl from loading a local resource.\r\n\r\n*Steps to reproduce*\r\n1. Run test case, with testpage.html as an additional resource\r\n2. See that \"I'm the property\" displays rather than \"I'm the local page\"\r\n3. Comment out the html property to see that now \"I'm the local page\" displays\r\n\r\n*app.js*\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow({\r\n\ttitle : 'Window',\r\n\tbackgroundColor : 'white',\r\n\tlayout : 'vertical'\r\n});\r\n\r\nwebView = Titanium.UI.createWebView({\r\n\twidth : Ti.UI.FILL,\r\n\theight : Ti.UI.FILL,\r\n\thtml : 'I\\'m the property'\r\n\t// ^^ Comment out html property to \"fix\" problem\r\n});\r\nwin.add(webView);\r\n\r\nwebView.setUrl(\"/testpage.html\");\r\n\r\nwin.open();\r\n{code}\r\n\r\n*testpage.html*\r\n{code:html}\r\n\r\n\t\r\n\t\tI'm the local page\r\n\t\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Setting html property in web view prevents setUrl from loading page", "creator": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "environment": "OSX 10.8\r\niOS 6.1\r\nXcode 4.6\r\nSDK 3.0.0GA, 3.2.0GA and 3.1.0GA", "comment": { "comments": [ { "id": "248830", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed on iOS 6 simulator, Ti SDK 3.1 GA.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-23T23:21:07.000+0000", "updated": "2013-04-23T23:21:07.000+0000" }, { "id": "318534", "author": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "body": "Any news on a fix for this please?", "updateAuthor": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "created": "2014-08-13T21:37:51.000+0000", "updated": "2014-08-13T21:37:51.000+0000" }, { "id": "318702", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Seems like the properties of the web view are processed after the window has opened. So the html override the URL. The workaround is to set the url after the window opens:\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n title : 'Window',\r\n backgroundColor : 'white',\r\n layout : 'vertical'\r\n});\r\n \r\nwebView = Titanium.UI.createWebView({\r\n width : Ti.UI.FILL,\r\n height : Ti.UI.FILL,\r\n html : 'I\\'m the property'\r\n});\r\nwin.add(webView);\r\nwin.open();\r\n\r\nwebView.setUrl(\"/pedro.html\");\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-14T18:58:23.000+0000", "updated": "2014-08-14T18:58:23.000+0000" }, { "id": "318778", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/5971/files", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-08-14T23:19:50.000+0000", "updated": "2014-08-14T23:19:50.000+0000" }, { "id": "413196", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue has been fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T21:51:44.000+0000", "updated": "2017-03-16T21:51:44.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }