Announcing the new <html/> tag for DHTML
Tuesday, January 30th, 2007I'm pleased to announce the introduction of the snappy new <html/> tag for DHTML. Essentially, it allows an HTML page to be embedded inside any OpenLaszlo component. Here's a simple demo browser:
http://labs.openlaszlo.org/legals-nightly/lps/components/extensions/test/html.lzx?lzr=dhtml&lzt=html
Here's the source for the app:
<canvas width="100%" height="100%">
<include href="extensions/html.lzx"/>
<class name="browser" extends="window" resizable="true" bgcolor="silver">
<edittext name="txt" text="http://openlaszlo.org/" width="300"/>
<button x="310" onclick="parent.htmlview.setSrc(parent.txt.getText()); parent.htmlview.setAttribute('visible', true)">Load</button>
<html name="htmlview" width="${parent.width - 19}" height="${parent.height - 74}" x="${parent.x + 7}" y="${parent.y + 53}"/>
</class>
<browser width="100%" height="100%" x="10" y="10"/>
</canvas>
As you can see, the HTML tag can be constrained to automatically resize to any view, in this case a window. The html tag's src attribute can also be set, or the setSrc() method can be called from LZX to reload the contents of the tag. It's a powerful feature, and we're looking forward to seeing all the exciting things you make with it!








