Usage
Signature:
interface CTrainElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CTrainElement } from "oj-c/train";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/train";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
selected-step* :string
-
Id of the currently selected step.
- Supports writeback:
true
Names
Item Name Property selectedStepProperty change event selectedStepChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selected-step-changed -
steps* :Array.<oj-c.Train.Step>
-
Array of step definitions.
- Default Value:
[]
Names
Item Name Property stepsProperty change event stepsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-steps-changed -
visited :Array<string>
-
The ids of the visited steps.
- Default Value:
'[]'
- Supports writeback:
true
Names
Item Name Property visitedProperty change event visitedChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-visited-changed -
width :(number|string)
-
Specifies the component style width.
Names
Item Name Property widthProperty change event widthChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-width-changed
Events
-
ojBeforeSelect
-
Note: The event detail contains the following properties: oj-c.Train.TrainSelectDetail
Triggered before a step is selected. Reject the returned promise to cancel selection.See Events and Listeners for additional information.
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesobject An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void
Type Definitions
Documentation-only Types
Note: Type definitions in this section have been provided for documentation purposes and cannot be imported into application code.
-
Step
-
Properties:
Name Type Argument Description disabledboolean <optional>
Determines if the step is disabled. idstring Unique step id. labelstring Step Label. messageType"error" | "confirmation" | "info" | "warning" | "fatal" <optional>
Step message type -
TrainSelectDetail
-
Payload for selection changes, containing the step id being selected.
Properties:
Name Type Description accept(acceptPromise:Promise<void>) => void This method can be called with an application-created Promise to cancel this event asynchronously. The Promise should be resolved or rejected to accept or cancel the event, respectively. idstring