<Image> can be used to embed graphics into Web Apps.
Instructions for use
An <Image> control is created with the <Image> element.
<Image>
...
</Image>
<Image> controls can be used in all available layout types: For more information, see Layouts.
Attribute
Note:
There are a number of default attributes that can be set for all controls. For more information about the default attributes, see Default attributes.
In addition to the default attributes, you can define the following attributes for <Image> controls.
|
Attribute |
Description |
|---|---|
|
|
Required Graphic that is displayed. Indicates a property (of type Possible values: File path to the location of the graphic or string for data binding (Image, Base64, String, URL) Note:
|
|
|
Defines whether a border is displayed around the control. Possible values: |
|
|
Defines whether a left border is displayed. Possible values:
|
|
|
Defines whether a right border is displayed. Possible values:
|
|
|
Defines whether a top border is displayed. Possible values:
|
|
|
Defines whether a bottom border is displayed. Possible values:
|
|
|
Height of the control Possible values: Any integer |
|
|
Defines the color of the icon. Possible values:
Note:
|
|
|
Specifies that a tooltip should be displayed under a graphic/icon.
Possible values: Any string or string for data binding |
|
|
Specifies the unit that applies to sizes. Possible values:
|
|
|
Width of the control Possible values: Any integer |
Note:
The size of the image can be adjusted using the general attributesheight and width. By default, this is in pixels.
If only height or width is specified, the aspect ratio is maintained. If both height and width are specified, the image will be distorted.
If size specifications are not defined either on the <Image> control or on the parent element (using the general attributes height and width), some browsers may experience display problems.
Actions
The following actions are available for <Image> controls. For more information about actions, see Actions.
<SelectAction>
You can insert the Select action using the <SelectAction/> element within <Image>. The action is triggered when the user selects the image.
Note:
You must insert the <SelectAction> element before the desired layout type (BoxLayout, FlowLayout, GridLayout, ResponsiveLayout, TabLayout).
<DoubleClickAction>
You can insert the DoubleClick action using the <DoubleClickAction/> element within <Image>. The action is triggered when the user double-clicks the image.
Note:
You must insert the <DoubleClickAction> element before the desired layout type (BoxLayout, FlowLayout, GridLayout, ResponsiveLayout, TabLayout).
Examples
Here you will find various examples of <Image> controls.
Example 1: <Image> from static resource
The following example shows how to use the <Image> tag.
<DetailComponent name="ExampleImage" path="ExampleImage" displayName="Example Image">
<FlowLayout>
<Image value="image.jpg"/>
</FlowLayout>
</DetailComponent>
Example 2: <Image> with data binding (dynamic from a Technical Process) - graphics in Base64 format
The following example shows how to use the <Image> tag with data binding.
<DetailComponent path="ExampleImageWithDataBinding" name="ExampleImageWithDataBinding" displayName="Example Image with Data Binding" default="true" process="Image.wrf">
<Properties>
<Property name="image" type="Base64" />
</Properties>
<FlowLayout>
<Image value="#image"/>
</FlowLayout>
</DetailComponent>
The data supplied by the Technical Process Image.wrf must have the following format:
<?xml version="1.0" encoding="UTF-8" ?>
<Ok>
<image mediaType="image/jpeg">
<!-- Base64String -->
</image>
</Ok>
Example 3: <Image> with data binding (dynamic from a Technical Process) - graphics from an external URL
The following example shows how to use the <Image> tag with data binding.
<DetailComponent
path="ExampleImageWithDataBinding"
name="ExampleImageWithDataBinding"
displayName="Example Image with Data Binding"
default="true"
process="Image.wrf">
<Properties>
<Property name="image" type="Image" />
</Properties>
<FlowLayout>
<Image value="#image"/>
</FlowLayout>
</DetailComponent>
The data supplied by the Technical Process Image.wrf must have the following format:
<?xml version="1.0" encoding="UTF-8" ?>
<Ok>
<image mediaType="image/png" type="external">
<![CDATA[https://softproject.de/de/wp-content/uploads/sites/2/2019/01/LogoSoftProject.png]]>
</image>
</Ok>