{ "id": "86938", "key": "TIMOB-8293", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13207", "name": "Sprint 2012-07", "archived": true, "released": true, "releaseDate": "2012-04-08" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-05T08:29:16.000+0000", "created": "2012-02-24T02:51:35.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "regression", "webview" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "17952", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "62090", "key": "TIMOB-1458", "fields": { "summary": "WebView doesn't keep html", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "16081", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "85091", "key": "TIMOB-7279", "fields": { "summary": "iOS: Add API to load WebView content from string with 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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-06-22T16:26:25.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": "h2. Problem\r\n\r\nIn our app we create one instance of Ti.UI.WebView and reuse it for showing html content which is stored in a sql db. As the user navigates to different entries within a messages list, the new selected content is pushed into the webview by asigning the value to the html property of the webview.\r\n\r\nThe first time the value is set, the content shows up as expected.\r\n\r\nIf the value is set the second time the webview shows up empty.\r\n\r\nh2. Test case\r\nCreate a fresh mobile project and replace the default app.js with the following code:\r\n{code:lang=javascript|title=app.js}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar\tbutton1 = Titanium.UI.createButton({\r\n\ttitle:'open webview window',\r\n\twidth:220,\r\n\theight:40\r\n});\r\n\r\nwin1.add(button1);\r\n\r\nvar winwebview = Titanium.UI.createWindow({ \r\n title:'Window with webview',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar webview = Titanium.UI.createWebView({\r\n});\r\n\r\nwinwebview.add(webview);\r\n\r\nvar counter = 0;\r\nbutton1.addEventListener('click',function(e)\r\n{\r\n counter++;\r\n webview.html = '

Counter is: ' + counter + '

';\r\n tab1.open(winwebview,{animated:true});\r\n});\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 2',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\n\r\n\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\n\r\n// open tab group\r\ntabGroup.open();\r\n{code}\r\n\r\n# Build an run the app in simulator.\r\n# Tap on the button \"open webview window\". \r\n# The webview shows the line \"Counter is: 1\".\r\n# Navigate back to Tab 1 and tap again on the button \"open webview window\".\r\n# The webview should show the line \"Counter is: 2\", but the webview shows up empty.\r\n\r\nWith Titaniums SDK 1.8.0.1 and 1.8.1 this works as expected.\r\n", "attachment": [], "flagged": false, "summary": "iOS: Subsequently setting the html property of a webview does not show the changed html but shows blank content", "creator": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 5.0.1 on simulator and iPHone 4 device\r\nMac OS X 10.7.3\r\nXcode 4.2.1\r\nTitanium Studio, build: 1.0.9.201202131024\r\nTitanium SDK versions: 1.8.2.v20120222170134, 2.0.0.v20120222180137 and 1.8.2 GA", "comment": { "comments": [ { "id": "185008", "author": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The bug also occurs in Titaniums SDK 1.8.2 GA", "updateAuthor": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-05T08:06:01.000+0000", "updated": "2012-03-05T08:06:01.000+0000" }, { "id": "185134", "author": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Posted on Q&A:\r\n\r\nhttp://developer.appcelerator.com/question/133230/ios-subsequently-setting-the-html-property-of-a-webview-does-not-show-the-changed-html-but-shows-blank-content", "updateAuthor": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-06T02:46:40.000+0000", "updated": "2012-03-06T02:46:40.000+0000" }, { "id": "188674", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "First bad commit: 53ffa8ad93c1f75c1e1a52a5fb4fa64ad112821a for TIMOB-7279", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T14:25:19.000+0000", "updated": "2012-03-26T14:25:19.000+0000" }, { "id": "189428", "author": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Stephen: I would be very glad to have this fixed in the upcoming SDK release 2.0.0. Any comments? Thank you.", "updateAuthor": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-01T22:55:30.000+0000", "updated": "2012-04-01T22:55:30.000+0000" }, { "id": "189571", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Dietrich -\r\n\r\nWe have already locked in non-critical fixes for our 2.0.0 release. This fix will appear on our continuous integration server when the bug is resolved.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-02T15:13:35.000+0000", "updated": "2012-04-02T15:13:35.000+0000" }, { "id": "189594", "author": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Stephan: That's odd! I think that reusing a webview instance ist not a rare use case, so i suspect that there will be a lot of post 2.0.0 release complaints about this bug.\r\n\r\nBut you may consider raising this bug to critical. This would allow the fix to make it into 2.0.0.", "updateAuthor": { "name": "level420", "key": "level420", "displayName": "Dietrich Streifert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-02T22:39:16.000+0000", "updated": "2012-04-02T22:39:16.000+0000" }, { "id": "189940", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed on master by PR #1907", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T08:29:16.000+0000", "updated": "2012-04-05T08:29:16.000+0000" }, { "id": "189965", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Fixed on 2_0_X by PR #1935", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T09:27:01.000+0000", "updated": "2012-04-05T09:27:01.000+0000" }, { "id": "190188", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Vishal investigating message in console: \"[WARN] couldn't load URL: app://com.appcelerator.timob8293/(null)\". My app ID is com.appcelerator.timob8293. Not sure if this is related to our network problems, this fix, or something else.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-06T12:48:44.000+0000", "updated": "2012-04-06T12:48:44.000+0000" }, { "id": "190205", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 2.0.1.v20120405211737 and Titanium Studio, build: 2.0.1.201204051443", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-06T15:10:21.000+0000", "updated": "2012-04-06T15:10:21.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }