Skip to content

Selectionhelper with renderStyle: 'custom' — slot children containing StaticImageViewer are not re-executable; workaround requires placeholder dynamictext #1057

Description

@acarum

Problem

When a selectionhelper widget uses renderStyle: 'custom', Mendix requires three child slots to be populated:

  • customallselected
  • customsomeselected
  • customnoneselected

Studio Pro places a Forms$StaticImageViewer (static image) inside each slot. When DESCRIBE PAGE is run on such a page, mxcli emits:

customallselected customallselected1 {
-- Forms$StaticImageViewer (staticImage3) -- NOT re-executable: mxcli cannot author this widget, so re-running this script would drop it
}

This means:

  1. mxcli cannot generate StaticImageViewer widgets inside selectionhelper slots.
  2. If a script is re-executed (idempotent CREATE OR REPLACE PAGE), the static images are silently dropped, leaving the slots empty.
  3. Empty slots cause CE0642 at build time:
    [CE0642] "Property 'All selected' is required."
    [CE0642] "Property 'Some selected' is required."
    [CE0642] "Property 'None selected' is required."

Current workaround

Populate each slot with an empty dynamictext to satisfy the structural requirement:

pluggablewidget 'com.mendix.widget.web.selectionhelper.SelectionHelper' selectionHelper1 (
renderStyle: 'custom',
Class: 'command'
) {
customallselected customallselected1 {
dynamictext txtAllSelected (Content: '')
}
customsomeselected customsomeselected1 {
dynamictext txtSomeSelected (Content: '')
}
customnoneselected customnoneselected1 {
dynamictext txtNoneSelected (Content: '')
}
}

This passes the build check but loses the visual icons present in Studio Pro-built pages.

Expected behavior

Either:

  • (A) mxcli supports staticimage (or equivalent) inside pluggable widget slots so the slot content round-trips faithfully, or
  • (B) DESCRIBE PAGE emits re-executable MDL for the slot content (e.g. using staticimage syntax), so CREATE OR REPLACE PAGE does not drop the children on re-execution.

Reproduction steps

  1. Open any Master page that uses selectionhelper with renderStyle: 'custom' (e.g. OpcenterEXFN_ReferenceData.UoMDimension_Master_SingleSelection).
  2. Run DESCRIBE PAGE — observe the -- NOT re-executable comment on slot children.
  3. Copy the DESCRIBE output into a CREATE OR REPLACE PAGE script and execute it — the static images are dropped.
  4. Run mx check — CE0642 errors appear on the three required slots.

Environment

  • Mendix version: 11.12.0
  • mxcli version: (0.21.0)

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

    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