Skip to content

Integration Button

The Integration Button is a button that stands for one vessel, or one system, in an application that integrates several. It shows a name and a status, and in its largest form also an info field and a few readouts. It is found in the App - OpenBridge section of the Perspective Component Palette as Integration Button (Experimental).

Note: This component is experimental: its properties may change in a later version.

Integration Button with an icon, a label, a status, an info field and two readouts

The parts of the button:

  1. Leading icon, label and status — see Label and Status and Icons.
  2. Info field — a label and a value at the bottom left, in the rich type. See Info Field and Readouts.
  3. Readouts — values at the bottom right, in the rich type.

The Integration Button belongs with two other components:

  • The Fleet Button stands for the fleet as a whole, where the Integration Button stands for one vessel.
  • The Integration Bar is the header of such a system. It shows the fleet in its vessel selector as a button of this kind.

See App Components — Overview for the other app components.

An Integration Button dropped from the palette is of the rich type, with the texts Label, Status, Info Label and Info Status:

Integration Button with default properties

type selects the layout. The blue frame in the images is the component’s box, 320 px wide:

type
rich (default) Label and status, and below them the info field and the readouts. Fills the width.
regular Label and status only. Fills the width.
hug Label and status only, as wide as its content.

Rich type

Regular type

Hug type

The button has its own height, from the top of the box: 106 px for rich and 58 px for the other two.

Name Description Property Type
type rich, regular or hug. Default rich. value

label is the name on the button. With hasStatus the text in status is shown under it; without it the button has one line, and a smaller leading icon.

hasStatus
true (default) Button with a status
false Button without a status
Name Description Property Type
label Text of the button. Default Label. value
hasStatus Show the status under the label. Default true. value
status Text of the status. Default Status. value

The button has room for an icon before the label and two after it. Each is turned on with a has… property and chosen with the icon picker.

No icon (default) Button without icons
hasLeadingIcon Button with a leading icon
hasTrailingIcon Button with a trailing icon
Both trailing icons Button with two trailing icons

The second trailing icon is drawn before the first, and only when hasTrailingIcon is also true.

In the rich type the trailing icons are at the top right:

Rich button with two trailing icons

Name Description Property Type
hasLeadingIcon Show an icon before the label. Default false. value
leadingIcon The icon, chosen with the icon picker. Only shown when hasLeadingIcon is true. object
hasTrailingIcon Show an icon after the label. Default false. value
trailingIcon The icon, chosen with the icon picker. Only shown when hasTrailingIcon is true. object
hasTrailingIcon2 Show a second icon after the label. Needs hasTrailingIcon. Default false. value
trailingIcon2 The icon, chosen with the icon picker. Only shown when hasTrailingIcon2 is true. object

The rich type has a second row. The other types do not show it.

At the left is the info field: infoLabel with infoStatus in bold under it. Clear both for a button without it.

Info field Rich button with an info field
Both texts empty Rich button without an info field

At the right are the readouts. readouts is a list, and each readout is an object:

Name Description Property Type
label Text above the value. value
value The value: a number or a text. value
unit Unit shown after the value. value
Readouts
1 One readout
2 Two readouts
3 Three readouts

The button shows the value as it is. To control the number of decimals, format the value in the binding, for example with the expression numberFormat({[default]Nordkapp/Speed}, "0.0").

Name Description Property Type
infoLabel Label of the info field. Default Info Label. value
infoStatus Value of the info field. Default Info Status. value
readouts The readouts. Empty by default. array

Set selected to true to show the button as the chosen one:

selected
false (default) Button, not selected
true Selected button

A click on the button does not change selected. It fires onActionPerformed, and your script or binding decides what is selected. Bind selected to the property that holds the choice, as in Example 1.

Name Description Property Type
selected Show the button as selected. Default false. value

Set disabled to true to show the button as unavailable and ignore the operator’s clicks. The event then does not fire.

Disabled button

Name Description Property Type
disabled Disable input from the operator. Default false. value

Properties not covered in the sections above:

Name Description Property Type
dividerBottom Meant to draw a divider under the button, for buttons in a list. It currently has no visible effect when the button is used on its own. Default false. value

The Integration Button has no style property.

Event Description Event Object
onActionPerformed Fired when the operator clicks the button. Not fired when disabled is true. —

The session has a custom property vessel that holds the chosen vessel, and selectedVessel of the Integration Bar is bound bidirectionally to it.

  1. Drop an Integration Button into the view, 320 × 106.

  2. Set label to MS Nordkapp, hasLeadingIcon to true and leadingIcon to a ship icon.

  3. Bind status to [default]Nordkapp/Status, set infoLabel to Destination and bind infoStatus to [default]Nordkapp/Destination.

  4. Set readouts, and bind each value to a tag:

    [
    {"label": "Speed", "value": 14.2, "unit": "kn"},
    {"label": "Course", "value": "274°", "unit": ""}
    ]
  5. Bind selected to the expression {session.custom.vessel} = "nordkapp".

  6. Add a script to onActionPerformed:

    self.session.custom.vessel = 'nordkapp'

Repeat for each vessel, or place the button in a view with a vessel parameter and show it in a Flex Repeater.

Built on the OpenBridge Design System