Skip to content

Widget DataSource does not accept association path ($var/Module.Assoc) #198

@ako

Description

@ako

Problem

DATAGRID, LISTVIEW, and GALLERY widgets fail to parse when their DataSource is an association path expression like \$currentObject/Module.AssociationName. Studio Pro calls this data source type "By Association" — it's a core pattern for master-detail pages.

Reproduction

CREATE PAGE Module.OrderDetail
(
  Title: 'Order Details',
  Layout: Atlas_Core.Atlas_Default
)
{
  DATAVIEW dv (DataSource: Module.Order) {
    DATAGRID items (DataSource: \$currentObject/Module.Order_OrderLine) {
      ...
    }
  }
};

Parser error at \$currentObject/. The / after \$currentObject isn't accepted.

Root cause

Grammar rules for widget DataSource: expressions accept only a qualifiedName (entity type) or a microflow reference, not an association path starting from a context variable.

Suggested fix

Extend the widget DataSource: grammar to accept association paths. When emitting BSON:

  • Currently mxcli emits ListOperation\$TypeDataSource or similar
  • For association paths, emit ListOperation\$AssociationDataSource (or the equivalent Studio Pro type) with the association ID and the context variable reference

The syntax should mirror how XPath constraints already use \$var/Module.Assoc/... — see .claude/skills/mendix/xpath-constraints.md.

Why it matters

Master-detail pages (most common CRUD pattern) cannot be fully generated from MDL without this. Users have to fall back to Studio Pro to configure the data source type, which defeats the purpose of MDL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions