Skip to content

uc-apx create dynamic-action toggle

Splice a dynamicAction that pairs native-hide + native-show actions under a single change-triggered DA. Canonical “depends-on” pattern: show a set of items/region when a controlling item has a certain value.

—trigger-item is the item whose change event fires the DA. —affected-items (CSV) or —affected-region selects what to show/hide. —condition-item + —condition-value emit a clientSideCondition so the show action fires when the condition is true and the hide action fires when it is false. Both flags must be set together or not at all.

uc-apx create dynamic-action toggle [flags]
FlagTypeDefaultDescription
--affected-itemsstringCSV of item ids to show/hide (one of —affected-items or —affected-region required)
--affected-regionstringRegion id to show/hide (one of —affected-items or —affected-region required)
--condition-itemstringItem id for clientSideCondition (must pair with —condition-value)
--condition-valuestringValue for clientSideCondition (must pair with —condition-item)
--dry-runPrint rendered dynamicAction to stdout without writing
--namestringDisplay name (default: “Toggle <trigger-item>“)
--pagestringTarget page (numeric ID, alias, or name) [required]
--sequenceintexecution.sequence (default: max existing dynamicAction sequence + 10)
--trigger-eventstringOverride the trigger event (default: omitted, APEX uses change)
--trigger-itemstringPage item id whose change event triggers the DA [required]
FlagTypeDefaultDescription
--app-dirstring.Path to the APEX application directory
--json-prettyOutput in pretty-printed JSON (human-readable) instead of minified JSON
--toonOutput in TOON format (human-readable, token-efficient) instead of JSON

Using --dry-run to preview the generated construct (no files are written):

Terminal window
uc-apx --app-dir examples/brookstrut create dynamic-action toggle --page 46 --name Toggle Facets --trigger-item P46_NAVIGATION --affected-region @facets --dry-run
Generated APEXlang
dynamicAction toggle-P46_NAVIGATION (
name: Toggle Facets
execution {
sequence: 20
}
when {
selectionType: items
items: P46_NAVIGATION
}
action native-hide (
action: hide
affectedElements {
selectionType: region
region: @facets
}
execution {
sequence: 10
}
)
action native-show (
action: show
affectedElements {
selectionType: region
region: @facets
}
execution {
sequence: 10
}
)
)