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.
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.
Name | Description | Property Type |
---|---|---|
value | The 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. |
setValue | The 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. |
primary | Toggle between the default primary and secondary button style. Default is true. | value: boolean |
enabled | Whether the user can interact with the One-Shot Button. If disabled, the component cannot be used. Default is true. | value: boolean |
readyState | Displays the readyState value on the component.
| object |
writingState | Displays the writingState value on the component.
| object |
confirm | If 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. | object |
style | Sets 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 |
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
Property | Value | Style Category |
---|---|---|
props.readyState.text | Start Process | N/A |
props.readyState.icon.path | material/trending_flat | N/A |
props.readyState.icon.color | #008000 | N/A |
props.writingState.text | Starting | N/A |
props.writingState.style.backgroundColor | #8AFF8A | background |