🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators ListActions
This page was created by Stephanie on 2024-12-11. Last edited by Wikiadmin on 2026-07-29.

You can use ListActions in a ViewModel selfVM context to retrieve the actions available for a nesting and use their metadata when you create a custom action display in the UI.

Purpose

ListActions returns a collection of ActionInstance values for the specified nesting. Each value describes one available action, including its name, enabled state, grouping, hint text, and whether it navigates to another ViewModel.

Use ListActions when the standard action presentation does not meet your UI requirements and you need to inspect the actions that the ViewModel makes available.

Argument

Argument Type Description
nameofNesting String The name of the ViewModel nesting whose available actions you want to retrieve.

Use selfVM.Nesting to provide the nesting name. This retains error checking if the nesting is renamed. Avoid entering a literal nesting name when selfVM.Nesting is available.

Return value

ListActions returns Collection(ActionInstance): one ActionInstance for each action available on the specified nesting.

For example, a custom UI can inspect each returned item and show its ActionName as the label, its Hint as hover text, and use Enabled to determine whether the UI control is enabled. An action with Enabled set to false can still provide a hint that explains its state.

ActionInstance attributes

Attribute Type Description
ActionName String The name of the action.
Enabled Boolean true when the action is enabled.
Group String The name of the menu group for the action.
Hint String Extra information shown when the pointer is over the action UI widget. A hint is available for both enabled and disabled actions.
IsNavigating Boolean true when the action navigates to another ViewModel.
NestingName String The name of the ViewModel nesting that owns the action.
Presentation String The string representation of the ViewModel.

Use the action metadata in a custom display

  1. Identify the nesting whose actions you want to present.
  2. Retrieve its available actions with ListActions, using selfVM.Nesting for the nesting reference where applicable.
  3. Iterate over the returned ActionInstance collection in your custom UI logic.
  4. Display ActionName and group actions by Group when your UI uses menus or grouped commands.
  5. Bind the action control's enabled state to Enabled.
  6. Show Hint for both enabled and disabled controls so users can receive information about an unavailable action.
  7. Treat actions where IsNavigating is true as actions that open or move to another ViewModel.

Related action operators

Use CanExecuteAction when you need a Boolean check for whether one named action can run in a named nesting. ListActions instead returns the available actions and their UI-related metadata.

See also