What is wrong in this openlaszlo code?

209 Views Asked by At

i want to know what is wrong in this code

<canvas> 
    <view y="50" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
        <resizestate name="res"/>
        <dragstate name="drg"/>
        <text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
        <html id="ht" src="text.html" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
    </view>
</canvas>

The code gets compiled but i am not able to see the html in swf version but i am able to see the html in dhtml version. I tried specifying the url too Still no results

2

There are 2 best solutions below

1
On BEST ANSWER

It looks like the <html> tag functionality is broken in the SWF10 runtime of OpenLaszlo 5.0 (trunk) for some Webkit based browser (Chrome and Safari), but there are other problems as well. I've modified the code a bit to do some testing:

<canvas>
  <button text="OpenLaszlo" onclick="ht.setAttribute('src', 'http://www.openlaszlo.org')" />
  <button y="40" text="test.html" onclick="ht.setAttribute('src', 'test.html')" />
  <view y="200" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
    <resizestate name="res"/>
    <dragstate name="drg"/>
    <text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
    <html id="ht" src="http://www.openlaszlo.org" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
  </view>
</canvas>

Here are the results I'm seeing with this code for the SWF10 runtime:

  • InternetExplorer 9, Chromium 18 and Opera 12: Both pages (local test.html and OpenLaszlo) are displayed within the iFrame.
  • Firefox: Remote website OpenLaszlo.org displays, but local test.html is not shown.
  • Safari 5.1 and Chrome 21: Both pages are not shown within the iFrame

I would file an OpenLaszlo Jira bug, and send a message to the laszlo-dev developer mailing list referring to this discussion.

0
On

I've been developing in OpenLaszlo since 2006 and my personal experience with trying to use the OpenLaszlo <html> tag under the SWF run-time is that half of the pages I load into it work, half of them don't. I've come across situations where even simple web pages from Google will not work, it is a pretty unstable class, I do not recommend using it.