- Print
- DarkLight
- PDF
Description
Links two groups of app objects together for a specified purpose.
Input Parameters
Name | Type | Required | Description |
---|---|---|---|
source | Text | Yes | Comma-seperated list of app object token(s) or name(s) that influence target group when selected |
target | Text | Yes | Comma-seperated list of app object token(s) or name(s) that are influenced by source group |
actions | Text | Yes | Comma-seperated list of actions taken on target when source is selected |
Supported Actions
Action | Description |
---|---|
enable | Target is enabled |
disable | Target is disabled |
show | Target is set to visible |
hide | Target is set to invisible |
paint | Target is painted (colored) |
unpaint | Target is unpainted (uncolored) |
Returns
No return value.
Examples
// when [10] is selected, [1], [4], and [7] are disabled
app.link("[10]", "[1], [4], [7]", "disable");
// when [10] is selected, [1], [4], and [7] are painted
app.link("[10]", "[1], [4], [7]", "paint");
// when [10] is selected, [1], [4], and [7] are painted + enabled
app.link("[10]", "[1], [4], [7]", "paint, enable");
// trigger different actions on [1], [4], and [7] when different values of [10] are selected
app.link("[10|Blue]", "[1], [4], [7]", "enable");
app.link("[10|Green]", "[1], [4], [7]", "paint");
Remarks
The target actions occurs when a source object is selected. This means that an opposite action will occur (when applicable) on the target objects when a source object is unselected.
When a source object supports multiple values, an optional value qualifier can be specified to trigger the action only when that value is specified. When multiple values are desired, a separate call to link is required, but also provides the flexibility to trigger different actions from each qualified value within the same source object.
Don't link multiple sources to the same target(s), each with a different action(s). This will lead to unexpected behavior since the runtime only runs actions when a particular source is changed. It will not re-run all other links to ensure they are in coordination. This limitation is enforced to avoid a negative performance impact.
Linking groups of app objects is powerful and can offer an enhanced user experience. However, this can also over-complicate the user experience. Experimentation can help strike the right balance.
This function uses the native app object token syntax, which refers to the ID of an object within your app that is enclosed in square brackets.
Example: [10]