Skip to content

Slide Button

The Slide Button is a slide-to-confirm button: the operator must drag its handle to the end of the track to perform the action. Use it for actions that must not be started by an accidental click, such as stopping a machine. It is found in the Input - OpenBridge section of the Perspective Component Palette as Slide Button (Experimental).

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

Slide Button with an icon and the label Slide to stop

  1. Handle with an icon and a label — see Label and Icon.
  2. Track with arrows that show the direction to slide — see Sliding.

The Slide Button is one of the input components. Events, disabling, icons and the behavior in the Designer are shared by all of them and are described in Input Components — Common Features. This page covers what is specific to the Slide Button.

A Slide Button with default properties. The blue frame is the component’s box:

Slide Button with default properties

A new Slide Button is 200 px wide, which is too narrow for its default label and icon: the arrows at the end of the track are cut off. Make the component wider; at 280 px it looks like this:

Slide Button with default properties, 280 px wide

The Slide Button has no value. The operator presses the handle, drags it to the right and releases it:

Slide Button with the handle dragged to the end of the track

  • When the handle is released at 80 % of the way or more, the component fires the onActionPerformed event once. The handle then returns to the start.
  • When the handle is released earlier, it returns to the start and nothing happens.
  • A click on the button without dragging does nothing.

With the keyboard, the operator moves focus to the handle with Tab and presses Enter or Space. This fires the event in the same way as a completed slide.

A disabled Slide Button cannot be slid and does not fire the event.

Set autoDisable to true to make the button disable itself after a completed slide, so that the action cannot be repeated by sliding again. The button is then drawn as disabled and ignores further slides.

Note: The component does not change the disabled property when it disables itself; the property stays false. To control from a tag or a script when the button can be used, leave autoDisable at false and bind disabled instead (see Example 1).

Name Description Property Type
autoDisable Disable the button after a completed slide. Default false. value

label is the text on the handle. Keep it short and say what sliding does, for example Slide to stop.

The handle shows an icon before the label when hasLeadingIcon is true. icon is an icon picker: choose the icon in the property editor, which sets icon.path. See Icons.

hasLeadingIcon Image
true (default) Slide Button with an icon
false Slide Button without an icon
Name Description Property Type
label Text on the handle. Default Slide to confirm. value
hasLeadingIcon Show an icon before the label. Default true. value
icon The icon on the handle. An icon picker; see icon.path. Only shown when hasLeadingIcon is true. object
icon.path Path of the icon. Default openbridge/placeholder. value

The button fills the width of the component. Set hugContent to true to make it only as wide as its label and icon need. The blue frame in the images is the component’s box:

hugContent Image
false (default) Slide Button that fills the width
true Slide Button that hugs its content

With hugContent set to true the button can become wider than the component’s box when the box is narrower than the label needs.

Name Description Property Type
hugContent Make the button only as wide as its content needs. Default false. value

Disabled Slide Button

See Disabled for the disabled property, which works in the same way on every input component.

Event Description Event Object
onActionPerformed Fired when the operator completes a slide, or presses Enter or Space on the handle. —

See Events.

  1. Drop a Slide Button into the view and set its width to 280.

  2. Set label to Slide to stop and choose the icon openbridge/standby for icon.

  3. Configure the onActionPerformed event with a script action:

    def runAction(self, event):
    system.tag.writeBlocking(['[default]Pump01/StopCommand'], [True])
  4. Bind disabled to an expression that is true when the pump is not running, for example !{[default]Pump01/Running}. The button is then disabled as soon as the pump has stopped, and enabled again when it runs.

Built on the OpenBridge Design System