Skip to content

Chart widgets not authorable via mxcli MDL (bundled .mpk only registers first widget; series datasource; AreaChart CE0463) #679

@ako

Description

@ako

Summary

Chart widgets (BarChart, ColumnChart, PieChart, LineChart, …) are not authorable via mxcli MDL today, blocking the recommended dashboard recipe. Three distinct gaps, one with a clear root cause.

1. Most chart widgets have no registry definition (P1) — root cause found

exec of pluggablewidget 'com.mendix.widget.web.barchart.BarChart' … fails with "no definition for widget … (run 'mxcli widget init')" even after widget init, which registers only areachart, progressbar, progresscircle, barcodescanner.

Root cause: both ParseMPK (sdk/widgets/mpk/mpk.go, def generation) and getWidgetIDFromMPK (used by FindMPK, augmentation) read only WidgetFiles[0] — the first widget in a package. Charts.mpk is one bundle of 10 widgets (AreaChart, BarChart, BubbleChart, ColumnChart, CustomChart, HeatMap, LineChart, PieChart, TimeSeries, ChartPlayground), with AreaChart first — so only AreaChart ever gets registered/augmented. (ProgressBar/ProgressCircle/BarcodeScanner ship as single-widget .mpks, so they're fine.)

This is the same WidgetFiles[0] limitation noted as latent in #600; Charts is the genuinely-bundled package that triggers it. Fix: parse all widget files per .mpk (def generation, FindMPK registration, and per-widget augment selection).

2. Object-list item (series) datasource can't be expressed (P1)

The grammar accepts series s1 (…) with scalar sub-properties and a { body }, but a custom-named datasource-typed sub-property fails: series s1 (staticDataSource: DATABASE FROM …) errors because the generic IDENTIFIER: value branch only accepts scalar propertyValueV3, not a datasource expression. So a series' actual data binding (staticDataSource / dynamicDataSource, X/Y attributes, aggregation) can't be set — same root limitation as #643 (datasource-typed properties only work via the builtin DataSource: clause, not by name). The existing example mdl-examples/doctype-tests/32-pluggable-widget-object-lists-v010.mdl (OL05) documents this in its own NOTE and only exercises primitive series sub-properties.

3. AreaChart builds with CE0463 (P1, unconfirmed)

The one registered chart (AreaChart) reportedly builds with CE0463 "definition of this widget has changed" (envelope/augment drift) — same class as #600 (embedded 11.6 baseline vs installed Charts 6.x). Not independently reproduced here; needs Studio-Pro verification.

Net / impact

The architecturally-correct dashboard recommendation (Charts widget) currently requires Studio Pro or the experimental MCP backend. Headless/mxcli-only authoring falls back to styled-container "charts."

Fixes

Repro

create or replace page MyFirstModule.Dashboard (Title: 'D', Layout: Atlas_Core.Atlas_Default) {
  pluggablewidget 'com.mendix.widget.web.barchart.BarChart' bc (DataSource: DATABASE FROM MyFirstModule.E) { }
}

mxcli exec → "no definition for widget com.mendix.widget.web.barchart.BarChart" (even after mxcli widget init).

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