In the WebView, HTML code can either be displayed statically, which is loaded as a file or via a URL from the network (Internet).
Communication from HTML to the IRControl App
The functions app.call (function, parameter) for calling actions and app.getData (function) for retrieving data from the app are available (see Control Attributes).
Images stored in IRControl can be loaded and displayed in HTML with the prefix «app:» (for example, <img src=“app:pic/ircontrol_logo.png“>)
Communication from IRControl App to the HTML page
An event handler can be used to call a javascript function, which must be present on the HTML page. To do this, the function is defined as an attribute (see Events).
Control attributes
URL | URL der Webseite, welche angezeigt wird (zb: http://www.cec.gmbh).
Es kann jeweils nur eine URL oder eine HTML Datei konfiguriert werden. |
HTML File | URL of the website, which is displayed (eg: http://www.cec.gmbh). Only one URL or one HTML file can be configured at a time. |
WebView Handler | WebView handlers define functionality, which is called via Javascript from the HTML file. The following two types of handlers are distinguished: call The call function can be used to call one or more actions (for example sending an infrared sequence). In Javascript, the handler is then called via the function «app.call (function, parameter)» (exact call is displayed in the table). The first parameter corresponds to the defined function name. 2. Parameter can be passed to the action for parameters. getData This WebView Handler can be used to query Javascript data that is available via a Dynamic Property from IRControl. For this a function name and a dynamic Propery must be defined. In JavaScript, the function is called with «app.getData (function)» (exact call is displayed in the table). The return value of the function corresponds to the return value of the dynamic property (see also Dynamic Attributes). |
Layout attributes
The Layout Attributes of a control are described in chapter Control Layout.
Actions
You can define actions for the following triggers:
onstart | will be executed while creating the page after the contro is initialized |
onstatechange | Will be called if the state attribute of the control changes. |
onrefresh | Will be executed, while the refresh event is sent |
Mehr zu Actions erfahrst Du im Kapitel Actions.
Events
Folgende Attribute können durch den Eventhandler manipuliert werden:
visible | true / false |
x | X coordinate |
y | Y coordinate |
width | width of the control |
height | height of the control |
rotate | rotation of the control (in degres) |
state | for customer puprpose usable attribute (see also the chapter State Attribute for more information) |
javaScript | When the event is triggered, the Javascript function of the loaded HTML defined in the value is called. |
In chapter Events you can read more about event handling.