Class: Image

Image

The Image control adds an Image to a Coach and can be programmed to have an on-click event.  The Image Control comes with many easy to configure behavior and appearance options. An Image control provides the following configuration properties in Process Designer:>

Behavior

Prevent Multiple Clicks: Prevent the user from clicking the image more than once boolean
Image URL Type: URL type. Note that for all images not being hosted on the local server, external should be used
{Web | External | Server | Design}
string
Image App Acronym: Acronym of the process app the image is located in. string
Default Image URL: If the control is not bound this is the URL for the image string
Default Image URL Type: If the control is not bound this is the URL type. Note that for all images not being hosted on the local server, external should be used
{Web | External | Server | Design}
string
Default Image App Acronym: If the control is not bound this is the acronym of the process app the image is located in. string

Appearance

Border Radius: Radius of curvature for the image corners string
Width: Width in px, %, em For example: 50px, 20%, 0.4em. If no unit is specified, px is assumed string
Height: Height in px, em For example: 50px, 0.4em. If no unit is specified, px is assumed string

Events

On Load:
Description: Triggers whenever the view is loaded.
Example:
console.log("Img1 successfully loaded")
On Click:
Description: Triggers when image is clicked, before navigating away from page. If evaluated expression returns false, the click will not fire a boundary event.
Example:
return ${Text1}.isValid();
Article(s)
Image

new Image()

This constructor is never used explicitly.

Extends

Members

Methods

Add/replace CSS class(es) for this control
Name Type Description
name string CSS class name(s) to add to the control. Separate class names by a space if more than one class.
replaced string optional CSS class name(s) to be replaced by the first argument. Separate class names by a space if more than one class.
Example
Button.addClass("green");

click()

Programmatically click this image

getType(){string}

Get descriptive string representing the type of control
Returns:
Type Description
string

getWidth(){string}

Get configured size for image (including unit)
Returns:
Type Description
string
Hide this view/control
Name Type Description
collapseFlag boolean Set to true to collapse the view (equivalent to a view setting of "NONE")
Example
MyView.hide();
Indicates bound status of control.
Returns:
Type Description
boolean True if the control is bound to coach data.
Checks if the view is enabled or not
Returns:
Type Description
boolean Enabled status
Example
var enabled = MyView.isEnabled();
Checks whether or not view is visible
Returns:
Type Description
boolean Visibility status
Example
var visible = MyView.isVisible();
Propagates value change of control up through parent views
Name Type Description
event Event Value change event (usually an onchange event)
Returns:
Type Description
boolean True if a formula update was triggered on the control's parent, otherwise false
Example
MyView.propagateUp(event);
Enable/disable this view/control
Name Type Description
enabled boolean Enabled/read-only flag (true to enable view, false to disable/make read-only)
required boolean Enable/disable required field flag for control
Example
MyView.setEnabled(false); //Make MyView read-only

setImage(img, type)

Set the image to be displayed
Name Type Description
img string Image url
type string "External" | "Web" | "Server" | "Design"
Example
${Image1}.setImage("Image1.png", "Web");

setRadius(radius)

Sets radius (roundness) of image
Name Type Description
radius string Border radius
Show/hide this view/control
Name Type Description
visible boolean Visibility flag (true to show view, false to hide)
collapse boolean Set to true to collapse the control space when visible is set to false.
Examples
MyView.setVisible(false, false); //Equivalent to MyView.hide()
MyView.setVisible(false, true); // Sets visibility to "None"

setWidth(width)

Set size of image (e.g. 50px, 20%, 2em - omitting the unit assumes px)
Name Type Description
width string the width of the image
Show this view/control
Example
MyView.show();
Broadcasts the expression trigger for the specified view
Name Type Default Description
phase int bpmext.ui.PHASE_NORMAL optional The phase we are currently in
Example
MyView.triggerFormulaUpdates();