Skip to content

PopupMenu menuTrigger child slot needs grammar keyword (CE0642 on fixture #32) #566

@ako

Description

@ako

Discovered while closing #548 (CE0463 on engine-routed pluggable widgets).

Symptom

After fixing CE0463 on `mdl-examples/doctype-tests/32-pluggable-widget-object-lists-v010.test.mdl`, `mx check` still reports:

```
[error] [CE0642] "Property 'The area to open or close the menu.' is required."
at Widgets container 'The area to open or close the menu.' of pop-up menu 'menu1'
[error] [CE0642] "Property 'The area to open or close the menu.' is required."
at Widgets container 'The area to open or close the menu.' of pop-up menu 'menu2'
```

The PopupMenu widget definition declares a required `menuTrigger` child slot (the clickable button that opens the menu). The fixture provides a button under a generic `container` keyword, expecting the engine to route it into `menuTrigger` — but the def.json's slot mapping uses `mdlContainer: "MENUTRIGGER"`, which isn't a grammar keyword, so no match.

Reproduction

```mdl
pluggablewidget 'com.mendix.widget.web.popupmenu.PopupMenu' menu1 (
trigger: 'onClick'
) {
-- intended as menuTrigger childSlot, but "container" doesn't match MENUTRIGGER
container trigger1 {
actionbutton btnTrigger (Caption: 'Actions', Action: close_page)
}
item itemNew (Caption: 'New', Action: close_page)
}
```

After `mxcli exec` and `mx check`: CE0642 on the missing menuTrigger.

Two fix options

A. Add MENUTRIGGER as a grammar keyword

Modify `mdl/grammar/MDLLexer.g4` to introduce `MENUTRIGGER` and route it through the keyword list in `mdl/grammar/domains/MDLSettings.g4` (`Object-list container keywords` block, line ~538). Update the fixture to use `menutrigger trigger1 { ... }`. Pros: explicit, matches the def.json convention used for GROUP, MARKER, SERIES, etc. Cons: per-widget grammar additions don't scale.

B. Drop the menuTrigger slot from def.json and let users wire it via existing widget keywords

Use `container` as the menuTrigger keyword, mark the def.json's first `container` child as the menuTrigger slot. Pros: no grammar change. Cons: ambiguous when a widget has multiple containers.

Recommended: A. The grammar already has 5 object-list container keywords (`GROUP`, `CUSTOMITEM`, `MARKER`, `DYNAMICMARKER`, `SERIES`); adding MENUTRIGGER follows the established pattern.

Out of scope

Priority

Low. The bare `acc2 / map1 / map2 / chart1` CE0463 closure (#548) is what makes the engine-routed widgets usable; PopupMenu trigger is one specific authoring path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions