Skip to main content
Version: 8.1

Perspective - One-Shot Button

Component Palette Icon:

Description‚Äč

The One-Shot Button is designed to send off a write request, and wait for a response, disabling the button until something resets the 'value' property on the component.

When the 'value' property and the 'setValue' property are equal, the component transitions to the writing state. Once 'value' and 'setValue' are no longer equal, the button returns to the ready state.

New in 8.1.2

The DateTime Picker component has three pre-configured variants:

  • Primary - Default design of the button.
  • Secondary - A secondary design for the button.
  • Require Confirm - Default design of the button but requires confirmation from user before action is submitted.

Properties‚Äč

Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.

NameDescriptionProperty Type
valueThe current value displayed on the component. Should be bound bi-directionally to a Tag. Default is 0.

New in 8.1.4
As of 8.1.4 the property type for value can be numeric, boolean, string, or null.
value:  numeric, boolean, string, or null.
setValueThe value to set when the button is pushed. Default is 1.

New in 8.1.4
As of 8.1.4 the property type for setValue can be numeric, boolean, string, or null.
value:  numeric, boolean, string, or null.
primaryToggle between the default primary and secondary button style. Default is true.value: boolean
enabledWhether the user can interact with the One-Shot Button. If disabled, the component cannot be used. Default is true.value: boolean
readyStateDisplays the readyState value on the component.
  • text: The text of the button while it's value is not being written. Value is string.
  • style: Modify readyState style using the style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
  • icon: The Icon is an image path used to augment the readyState of the component by placing an image next to it.
    • color: Color of the icon. Can also assign color in "fill" of the style property. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.
    • style: Modify the readyState style using the style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
    object
    writingStateDisplays the writingState value on the component.
  • text: The text of the button while it's value is not being written. Value is string.
  • style: Modify readyState style using the style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
  • icon: The Icon is an image path used to augment the readyState of the component by placing an image next to it.
    • color: Color of the icon. Can also assign color in "fill" of the style property. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.
    • style: Modify the readyState style using the style properties. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
    object
    confirmIf enabled, a message that asks the user to approve the requested operation. If the user doesn't confirm, then the value property will not update. 

    Note: When configuring a script on this component while confirm is enabled, it is generally recommend that the script is placed on the onActionPerformed component event, since that event will wait for user confirmation.  
  • enabled: If true, a confirmation box will be shown. Default is false. Value is boolean.
  • text: Message to show user if confirmation is enabled. Default is "Are you sure?". Value is string.
  • object
    styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.object
    disabledStyle
    New in 8.1.25
    Sets a style for this component when it is disabled.

    Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.
    object
    note

    If you are using both the style and disabledStyle properties, keep in mind that CSS dictates that style classes will be rendered in alphabetical order. In other words, specific elements of a style class will be overwritten if a later style class modifies the same element.

    Component Events‚Äč

    The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.

    Example‚Äč

    PropertyValueStyle Category
    props.readyState.textStart ProcessN/A
    props.readyState.icon.pathmaterial/trending_flatN/A
    props.readyState.icon.color#008000N/A
    props.writingState.textStartingN/A
    props.writingState.style.backgroundColor#8AFF8Abackground