IBM BPM version 8570 cumulative fix 2017.06Button control

This control creates a button that you use to advance from one coach to another or to exit a coach in a flow such as a human service.

Data binding

Set or modify the data binding for the Button control in the General properties tab. The control is bound to a Boolean variable.

Configuration properties

Set or modify configuration properties for the Button control, such as appearance and behavior properties, in the Configuration properties tab. Set the formula configuration properties in the Events tab.

Screen size
A configuration property that has the Screen Sizes icon The Screen Sizes icon beside the property name can have different values for each screen size. If you do not set a value, the screen size inherits the value of the next larger screen size as its default value. If you are using the Process Designer desktop editor, you are setting the value for the large screen size. The other screen sizes inherit this value.
Theme definitions
Theme definitions specify the colors and styles for a control and determine the appearance of the control. You can preview the look and feel of controls in the theme editor. See Themes.
The appearance configuration properties for the Button control are listed in the following table:
Table 1. Appearance configuration properties for the Button control
Appearance configuration property Description Data type
Color style The color style for the control. The colors correspond to variables in the specified theme. String
Shape The shape of the control. String
Size The size of the button. String
Outline only The control displays its color-based style only when you hover a cursor over it. By default, this property is not selected. Boolean
Icon The Screen Sizes icon The name of the icon that precedes the text on the button. For example: calendar, clock-o, camera, cloud-upload, bell, info, file-text.

See Font Awesome for a complete list of icons.

String
Width The Screen Sizes icon The width of the control. You can specify the width in px (pixels), % (percent), or em units. For example, 50px, 20%, or 0.4em. If a unit type is not specified, px is assumed.. String
The behavior configuration properties for the Button control are listed in the following table:
Table 2. Behavior configuration properties for the Button control
Behavior configuration property Description Data type
Tab index The tabbing sequence index of the form control. The tab indices start at 1 and can be set sparsely. For example, you can use 1, 5, 10. The Tab index property controls the tabbing sequence when you move between coach areas by pressing the Tab key. Integer
Prevent multiple clicks Prevents users from clicking the button more than once. Boolean

Example

As an example, say you want to add a validation button to advance from one coach to another in a client-side human service. To add the button to the human service flow, in the Coaches view, add a Button control to the layout of the first coach, and then set the following configuration properties for the button:
  1. Under Formula, specify the button name as a static text enclosed in double quotation marks, for example "OK".
  2. Under Behavior, select Prevent multiple clicks.
  3. Under Appearance, set Color style to Success, and leave Shape style and Size style set to Default. For Icon, type in check.
  4. Save your changes.

The result is a rectangular button that reads OK on a green background. The text on the button is preceded by a check mark.

Events

Set or modify the formula configuration properties and the event handlers for the control in the Events tab. You can set events to be triggered programmatically or when a user interacts with the control. For information on how to define and code events, see User-defined events.

The formula configuration properties for the Button control are shown in the following table:
Table 3. Formula configuration properties for the Button control
Formula configuration property Description Data type
Label formula The expression or formula that is used to set the label for the Button control. You can set the label either by using a static string or dynamically by using a formula. For example:
  • Static text enclosed in double quotation marks:
    "Static Button Text"
  • A formula to dynamically calculate the label:
    ${"Text1"}.getText()

For more information about using formulas, see Binding data and configuration options.

String

The Button control has the following types of event handlers:

  • On load: Activated when the page loads. For example:
    console.log("Button loaded")
  • On click: Activated when the link is clicked, before leaving the page. If the evaluated expression returns false, the click does not fire the boundary event. For example:
    return ${Text1}.isValid();
  • On boundary event: Activated when the flow reaches a stay-on-page event after the boundary event is fired through the Link control. For more information, see the context.trigger() property in the The coach view context object topic. For example:
    alert("Stay on Page status '" + status + "'")

Depending on the specific event, you can use JavaScript logic to modify the effects of the control. More information on using events with controls is found in the topic User-defined events.

Methods

For detailed information on the available methods for the Button control, see the JavaScript documentation.

Additional resources

For information about how to create a coach, see Building coaches.
For information about standard properties (General, Configuration, Positioning, Visibility, and HTML Attributes), see Coach view properties.