Project: titanium
Issue TIMOB-8293: iOS: Subsequently setting the html property of a webview does not show the changed html but shows blank content
h2. Problem In 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. The first time the value is set, the content shows up as expected. If the value is set the second time the webview shows up empty. h2. Test case Create a fresh mobile project and replace the default app.js with the following code: {code:lang=javascript|title=app.js} // this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000'); // create tab group var tabGroup = Titanium.UI.createTabGroup(); // // create base UI tab and root window // var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab 1', window:win1 }); var	button1 = Titanium.UI.createButton({	title:'open webview window',	width:220,	height:40 }); win1.add(button1); var winwebview = Titanium.UI.createWindow({ title:'Window with webview', backgroundColor:'#fff' }); var webview = Titanium.UI.createWebView({ }); winwebview.add(webview); var counter = 0; button1.addEventListener('click',function(e) { counter++; webview.html = '

Counter is: ' + counter + '

'; tab1.open(winwebview,{animated:true}); }); // // create controls tab and root window // var win2 = Titanium.UI.createWindow({ title:'Tab 2', backgroundColor:'#fff' }); var tab2 = Titanium.UI.createTab({ icon:'KS_nav_ui.png', title:'Tab 2', window:win2 }); var label2 = Titanium.UI.createLabel({	color:'#999',	text:'I am Window 2',	font:{fontSize:20,fontFamily:'Helvetica Neue'},	textAlign:'center',	width:'auto' }); win2.add(label2); // // add tabs // tabGroup.addTab(tab1); tabGroup.addTab(tab2); // open tab group tabGroup.open(); {code} # Build an run the app in simulator. # Tap on the button "open webview window". # The webview shows the line "Counter is: 1". # Navigate back to Tab 1 and tap again on the button "open webview window". # The webview should show the line "Counter is: 2", but the webview shows up empty. With Titaniums SDK 1.8.0.1 and 1.8.1 this works as expected.
Story points: 1