<html>
Adds the capability to display HTML pages.

JavaScript: lz.html
extends <view> » <node> » lz.Eventable »

<html> is a <view> that displays HTML pages.

For best results in Flash, set the wmode attribute to 'transparent' when embedding the application. See examples/extensions/html-swf.jsp for an example. See examples/extensions/html.lzx for an example of embedding <html> in a window.

<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="http://google.com/" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
    </view>
</canvas>

html extends <view>, which is the fundamental visual class of LZX. Note that child views aren't supported.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
focusable boolean boolean true read/write
   
framename string String   read/write
  Sets the name/target of the html iframe.
history expression Boolean true read/write
  If true, the html tag will set browser history.
html html String   read/write
  The HTML that the iframe starts out containing. Be sure to XML-escape any < > and & characters in the HTML.
iframeid expression any null read/write
   
loading boolean Boolean false readonly
  If true, the html tag is currently loading
minimumheight number Number 0 read/write
  The minimum height of the iframe: embedded swfs won't load with a size less than 1
minimumwidth number Number 0 read/write
  The minimum width of the iframe: embedded swfs won't load with a size less than 1
mouseevents boolean Boolean true read/write
  If true, attempt to listen for mouse events on the iframe. Cross-domain security restrictions apply, so if the content loaded in the iframe is from a different domain, mouse events won't be sent.
ready expression Boolean false readonly
  If true, the html tag is ready to receive commands
rpcmethods expression Array null read/write
  Contains a list of method names available to call with callRPC().
scrollbars boolean Boolean true read/write
  If true, the html tag will have scrollbars.
shownativecontextmenu boolean Boolean true read/write
  If true, show native context menus in the iframe. Otherwise, show OpenLaszlo context menus. Note that this only works in DHTML because it's not possible to programatically display a context menu in Flash.
src text String   read/write
  Sets the URL the html tag should load
target expression lz.view this.parent read/write
  Sets the view to listen to for x/y/width/height change events. Defaults to this.parent.
visible boolean Boolean true read/write
  Sets the visibility of the html tag

Methods

bringToFront()
html.bringToFront();

callJavascript()
html.callJavascript(methodName : String, callbackDel : lz.handler, ...args);
Calls a method in the the loaded page.
Parameter Name Type Description
methodName String The name of the method to call
callbackDel lz.handler An optional LzDelegate which will be called with the return value from the method call.
args ... Optional arguments to pass to the method.
Returns Type Description
  * returns the value if it can immediately be returned.

callRPC()
html.callRPC(methodName : String, callback : Function, ...args);
Calls a method in the the loaded page using pmrpc/jsonp with message passing. This can be used to call methods across iframes loaded from different domains. You must to register javascript functions for callback in the iframe with pmrpc for them to be available. If the HTML loaded into your <html></html> component includes lps/includes/iframestub.js, you can send events into the parent OL <html></html> object with the browser Javascript method lz.sendEvent(name, value). Please note that pmrpc requires IE 8 and above. See See http://code.google.com/p/pmrpc/ for more details about pmrpc.
Parameter Name Type Description
methodName String The name of the method to call
callback Function An optional function which will be called with the return value from the method call.
args ... Optional arguments to pass to the method.
Returns Type Description
  * returns the value if it can immediately be returned.

restoreSelection()
html.restoreSelection();
Restores a selection in the iframe. Currently only works in IE 7.

scrollBy()
html.scrollBy(x : Number, y : Number);
Scrolls the html tag to a specific position.
Parameter Name Type Description
x Number x position to scroll to
y Number y position to scroll to

sendToBack()
html.sendToBack();

setStyle()
html.setStyle(elementid : String, property : String, value : String);
Sets the CSS style of an iframe, or an element in the HTML loaded in the iframe.
Parameter Name Type Description
elementid String Specifies the ID of an element in the HTML loaded in the iframe. If null, the CSS is applied directly to the iframe.
property String The CSS property name to change, e.g. 'backgroundColor'
value String The CSS value to use, e.g. '#ff0000'

storeSelection()
html.storeSelection();
Stores a selection from the iframe, to be restored later by restoreSelection(). Currently only works in IE 7.

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onload  
onready  

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy