Module: structure/pure/ImageTrigger

Adds an image like the structure/pure/Image widget, but additionally the image can be changed by incoming
data and can send data to the backend by clicking on it.
There modes to react on incoming data:

  • type="show": Hides the image when incoming data == 0
  • type="select": Changes the image by appending the incoming data to the initial configured image source,
    or hide it when incoming data == 0

Example:

<imagetrigger src="icon/comet" suffix="svg" sendValue="clicked" type="select">
 <address transform="DPT:16.001" mode="readwrite">0/0/0</address>
</imagetrigger>

initially shows nothing. When the CometVisu receives the string '_icon' in address 0/0/0,
the image icon/comet_opt_icon.svg is shown. When the CometVisu receives '0' on address 0/0/0,
this image is hidden.

Since:
  • 0.8.0 (2012)
Author:
  • Christian Mayer
Source:

Examples

Image changed by incoming data 'blue'
Image changed by incoming data 'grey'

 <imagetrigger src="icon/CometVisu_" suffix="png" sendValue="clicked" type="select" width="45px" height="32px">
  <layout colspan="1"/>
  <address transform="DPT:16.001" mode="readwrite">0/0/0</address>
</imagetrigger>

Disable layout width by settings it to '0', to have widget with == image width

 <imagetrigger src="icon/CometVisu_orange" suffix="png" sendValue="clicked" type="show" width="45px" height="32px">
  <layout colspan="0"/>
  <address transform="DPT:1.001" mode="readwrite">0/0/0</address>
</imagetrigger>

Requires

Methods


<inner> action(path, actor, isCanceled)

Action performed when the image got clicked

Parameters:
Name Type Description
path String

Internal path of the widget

actor Element

DOMElement

isCanceled Boolean

If true the action does nothing

Source:

<inner> create(element, path, flavour, type)

Creates the widget HTML code

Parameters:
Name Type Description
element Element

DOM-Element

path String

internal path of the widget

flavour String

Flavour of the widget

type String

Page type (2d, 3d, ...)

Source:
Returns:

HTML code

Type
String

<inner> update(address, value)

Handles updates of incoming data for this widget

Parameters:
Name Type Description
address String

Source address of the incoming data

value String

Incoming data

Source: