Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23219] Windows: Parity: Cannot set HTML property on a webview

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2016-04-16T15:09:10.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sn/a
ComponentsWindows
Labelswindows_phone
ReporterRene Pot
AssigneeKota Iguchi
Created2016-04-15T13:44:26.000+0000
Updated2017-03-21T23:14:12.000+0000

Description

When trying to set html or a local url to a webview in Windows Phone, it fails. Example code:
$.webview.html = "<b>Test</b>"

Comments

  1. Sharif AbuDarda 2016-04-15

    Hello, This might help testing the issue. *app.js*
       
       var win = Ti.UI.createWindow();
       var webview = Ti.UI.createWebView({
       	url: 'local.html'
       });
       win.add(webview);
       win.open();
       
    *local.html*
       
       <html>
       	<head>
       		<title>Local HTML</title>
       		<link rel="stylesheet" type="text/css" href="local.css"/>
       		<script src="local.js"></script>
       	</head>
       	<body onload="addParagraphAlert();">
       		<p id="localtest">
       			Here some text that will be styled by the included local style sheet. If you click it,
       			the included local JS file will cause an alert to pop up.
       		</p>
       	</body>
       </html>
       
    *local.css*
       
       p {
       	color: #880000;
       	font-weight: bold;
       	font-size: 24px;
       }
       
    *local.js*
       
       function addParagraphAlert() {
       	document.getElementById('localtest').addEventListener('click', function(e) {
       		alert('you clicked the paragraph');
       	});
       }
       
    Regards, Sharif
  2. Rene Pot 2016-04-15

    hi, thanks. But setting the local URL doesn't work either. (as per title of this ticket). It crashes too. (unknown error it says)
  3. Christopher Williams 2016-04-15

    We've addressed the issue of not loading a local URL/HTML file in the related ticket I've linked: TIMOB-20143 I'm not sure if we also addressed setting HTML itself on the web view. Perhaps [~kota] knows..
  4. Christopher Williams 2016-04-15

    [~topener] You should be able to workaround this in the meantime (hopefully), from Kota's comments on the related ticket:
       var htmlPage = "/local.html";
       if(OS_WINDOWS){
         htmlPage = "ms-appx-web://" + htmlPage;
       }
       $.webview.url = htmlPage;
       
  5. Kota Iguchi 2016-04-16

    This issue should be fixed by TIMOB-20143, which is scheduled to release in 5.3.0. Works for me on latest 5.3.0 nightly. appc ti sdk install --branch 5_3_X 5.3.0.v20160415121959
  6. Kota Iguchi 2016-04-16

    Duplicate of TIMOB-20143
  7. Lee Morris 2017-03-21

    Closing ticket as duplicate with reference to the above comments and links.

JSON Source