Passing data between jigs
Often, you need to transfer or pass data between s to provide context and data, for example, when pressing on a customer in a list, the customer ID is passed to the order form, prepopulating the customer's details. This is accomplished by utilizing inputs and outputs.
- With inputs, parameters are configured in the first (sending ) with the input used in the receiving .
- The parameter and input work in conjunction with each other.
- The parameter requires a parameterName and a data value that is available in that .
- Multiple parameters can be passed through at once.
- The receiving configuration uses the format [email protected]. Use IntelliSense (ctrl+space) to assist with configuration.
- In a , you can access all data sent from other s using the expression @ctx.jig.inputs.[parameter], for example, [email protected][customerId = @ctx.jig.inputs.customerId]
- If you in a list-item component you don't need to list all the parameters, simply use: parameters: customer: [email protected]
Parameter: In the containing the data you want to transfer, configure the various parameters to be passed. Example:
parameters: packageDate: [email protected] packageName: [email protected]
Input: In the receiving configure the input for the data in the field or data property. Example: title: [email protected]
Outputs are configured in a and are then used as an input in a composite to pass data between the s in the composite . This confiugration is suitable for creating master detail screens, clicking on a component in one jig, populates the components and data in the next screen. Passing data values between s works both ways.
- An instanceId is required for the that is exposing an output in order to access the output via state from another .
- The data from configuring outputs can only be used in composite s.
- Using the output property must be reciprocated with an input property in the composite .
- The output requires an output-key and a data value that is available in that .
- The receiving configuration uses the format similar to [email protected]. Use IntelliSense (ctrl+space) to assist with configuration.
The output and input work in conjunction with each other.
Output: In the containing the data you want to transfer, configure the output-key. Example:
outputs: output-key: [email protected]
Input: In the receiving jig.composite configure the input for the data. Example: inputs: id: [email protected]