link
  • 04 Nov 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

link

  • Dark
    Light
  • PDF

Article Summary

Description

Links two groups of app objects together for a specified purpose.


Input Parameters

NameTypeRequiredDescription
sourceTextYesComma-seperated list of app object token(s) or name(s) that influence target group when selected
targetTextYesComma-seperated list of app object token(s) or name(s) that are influenced by source group
actionsTextYesComma-seperated list of actions taken on target when source is selected

Supported Actions

ActionDescription
enableTarget is enabled
disableTarget is disabled
showTarget is set to visible
hideTarget is set to invisible
paintTarget is painted (colored)
unpaintTarget 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.

Caution

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.

Token Syntax

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]


What's Next