Skip to content

CONTAINER Action: nanoflow does not support explicit parameter binding — CE1571 #1082

Description

@acarum

When a CONTAINER widget inside a DataGrid 2 controlbar has Action: nanoflow Module.NF, and that nanoflow declares a required entity parameter, Mendix raises CE1571 ("No argument has been selected for parameter") because there
is no MDL syntax to pass the datagrid's selection context into the nanoflow through a container action.

Environment

  • Mendix: 11.12.0
  • mxcli: local binary (.0.21.0)
  • Widget: DataGrid 2 (datagrid) controlbar, CONTAINER with Action: nanoflow

Steps to Reproduce

  1. Create a nanoflow with an entity parameter:
    CREATE OR MODIFY NANOFLOW CustomModule.ACT_UnLinkMaterialDefinition_NF (
    $LogisticWhitelist: CustomModule.LogisticWhitelist
    )
    BEGIN
    -- ... uses $LogisticWhitelist
    END;
    /

  2. Reference it from a container inside a datagrid controlbar:
    datagrid dgMaterials (
    DataSource: database from CustomModule.LogisticWhitelist where [...],
    Selection: Single
    ) {
    -- Context: $currentObject (CustomModule.LogisticWhitelist), $dgMaterials (selection)
    controlbar controlBar1 {
    container containerUnlinkMat (
    Class: 'command',
    Action: nanoflow CustomModule.ACT_UnLinkMaterialDefinition_NF
    ) {
    actionbutton btnUnlink (Caption: 'Unlink', Icon: 'Atlas_Core.Atlas_Filled.trash-can')
    }
    }
    }

  3. Run mx check:
    [error] [CE1571] "No argument has been selected for parameter 'LogisticWhitelist'
    and no default is available. Please select an argument manually."
    at Container 'containerUnlinkMat'

Root Cause

The CONTAINER widget's Action: clause in MDL does not support explicit parameter binding. It accepts only Action: nanoflow Module.NF (no argument list). This means there is no way in MDL to pass $currentObject or the datagrid
selection variable ($dgMaterials) to a parameterised nanoflow via a container action.

In contrast, ACTIONBUTTON supports explicit binding:
actionbutton btnUnlink (
Caption: 'Unlink',
Action: nanoflow CustomModule.ACT_UnLinkMaterialDefinition_NF ($LogisticWhitelist = $dgMaterials)
)
This compiles and runs correctly.

The DESCRIBE output confirms the datagrid exposes the selection context:
-- Context: $currentObject (CustomModule.LogisticWhitelist), $dgMaterials (selection)
Both $currentObject and $dgMaterials are in scope, but neither can be forwarded through a CONTAINER action.

Expected Behaviour

Either:

  • Option A: MDL should support explicit parameter binding on CONTAINER Action: nanoflow, e.g.:
    Action: nanoflow Module.NF ($Param = $dgMaterials)
  • Option B: When the nanoflow has exactly one parameter whose type matches $currentObject's type, the runtime should automatically bind it — consistent with how Studio Pro resolves context in containers.

Actual Behaviour

CE1571 at build time. The only workaround is to replace the CONTAINER with an ACTIONBUTTON with an explicit ($Param = $dgWidgetName) binding — which changes the visual rendering (command-style container pattern cannot be
used).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions