You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(alter-page): INSERT INTO container — append widgets as a container's children
ALTER PAGE could only INSERT BEFORE/AFTER a sibling widget, so there was no way to
fill an EMPTY container or add a widget to a container/dataview without an existing
sibling to anchor to. Add:
alter page Mod.Page { insert into containerName { <widgets> } }
which appends the widgets as the last children of the named container. Full-stack:
grammar (INSERT INTO), visitor (Position "INTO"), executor (children take the
target's own entity context, e.g. a dataview's entity), and both mutators
(pagemutator for MPR files, MCP for live Studio Pro). An empty container omits its
Widgets list, so it is created with the Mendix widget-list marker and written back
into the parent (the bson.D grows). Simple containers are supported (DivContainer,
Container, DataView, GroupBox, ScrollContainerRegion, Section); LayoutGrid and
TabContainer have no single child list and give a clear error pointing to
INSERT BEFORE/AFTER inside the target column/tab.
Verified on 11.12.1: insert into an empty container, append to a non-empty one, and
insert a data-bound widget into a dataview — mx check 0 errors. Unit test for the
mutator INTO path + error case; doctype example; skill / quick-reference / syntax
help updated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
Syntax: "ALTER PAGE Module.Name {\n SET property = value ON widgetName;\n SET (prop1 = val1, prop2 = val2) ON widgetName;\n SET Title = 'New Title'; -- page-level (case-sensitive)\n SET Class = 'css-class'; -- page-level CSS class / style\n SET Style = 'css: rule';\n SET PopupWidth = 800; -- page-level pop-up dimensions\n SET PopupHeight = 480;\n SET PopupResizable = true;\n INSERT AFTER widgetName { <widgets> };\n INSERT BEFORE widgetName { <widgets> };\n DROP WIDGET name1, name2;\n REPLACE widgetName WITH { <widgets> };\n};",
92
+
Syntax: "ALTER PAGE Module.Name {\n SET property = value ON widgetName;\n SET (prop1 = val1, prop2 = val2) ON widgetName;\n SET Title = 'New Title'; -- page-level (case-sensitive)\n SET Class = 'css-class'; -- page-level CSS class / style\n SET Style = 'css: rule';\n SET PopupWidth = 800; -- page-level pop-up dimensions\n SET PopupHeight = 480;\n SET PopupResizable = true;\n INSERT AFTER widgetName { <widgets> };\n INSERT BEFORE widgetName { <widgets> };\nINSERT INTO containerName { <widgets> };\nDROP WIDGET name1, name2;\n REPLACE widgetName WITH { <widgets> };\n};",
93
93
Example: "ALTER PAGE Module.EditPage {\n SET (Caption = 'Save & Close', ButtonStyle = Success) ON btnSave;\n INSERT AFTER txtName {\n TEXTBOX txtMiddleName (Label: 'Middle Name', Binds: MiddleName)\n };\n DROP WIDGET txtUnused;\n};",
Syntax: "ALTER SNIPPET Module.Name {\n SET property = value ON widgetName;\n INSERT AFTER widgetName { <widgets> };\n INSERT BEFORE widgetName { <widgets> };\n DROP WIDGET name1, name2;\n REPLACE widgetName WITH { <widgets> };\n};",
155
+
Syntax: "ALTER SNIPPET Module.Name {\n SET property = value ON widgetName;\n INSERT AFTER widgetName { <widgets> };\n INSERT BEFORE widgetName { <widgets> };\nINSERT INTO containerName { <widgets> };\nDROP WIDGET name1, name2;\n REPLACE widgetName WITH { <widgets> };\n};",
`INSERT INTO <container>` appends widgets as the container's last children — the only way to fill an **empty** container, and handy for adding to a container or data view without a sibling to anchor to. Widgets inserted into a data view take that data view's entity. Supported on simple containers; for a layout grid or tab container, insert relative to a widget inside the target column/tab instead.
123
+
115
124
The inserted widgets use the same syntax as in `CREATE PAGE`. Multiple widgets can be inserted in a single block.
Copy file name to clipboardExpand all lines: docs-site/src/reference/page/alter-page.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,9 @@ SET 'propertyName' = value ON widgetName;
29
29
INSERT BEFORE widgetName { widget_definitions };
30
30
INSERT AFTER widgetName { widget_definitions };
31
31
32
+
-- Insert widgets as the last children of a container
33
+
INSERT INTO containerName { widget_definitions };
34
+
32
35
-- Remove widgets
33
36
DROP WIDGET widgetName1, widgetName2;
34
37
@@ -68,6 +71,12 @@ For pluggable widget properties, use quoted property names (e.g., `'showLabel'`)
68
71
69
72
Inserts new widgets immediately before or after a named widget within its parent container. The new widgets use the same syntax as in `CREATE PAGE`.
70
73
74
+
### INSERT INTO
75
+
76
+
Appends new widgets as the **last children** of a named container. This is the only way to fill an **empty** container, and the natural way to add a widget to a container or data view without needing a sibling to anchor to. Widgets inserted into a data view take that data view's entity as their context.
77
+
78
+
Supported on simple containers (container/DivContainer, data view, group box, scroll-container region). A layout grid (rows/columns) and tab container have no single child list — insert relative to a widget inside the target column or tab instead.
79
+
71
80
### DROP WIDGET
72
81
73
82
Removes one or more widgets by name. The widget and all its children are removed from the tree.
Copy file name to clipboardExpand all lines: docs/01-project/MDL_QUICK_REFERENCE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -982,6 +982,7 @@ Modify an existing page or snippet's widget tree in-place without full `create o
982
982
| Widget dynamic classes |`set DynamicClasses = 'expr' on widgetName`| Runtime-computed classes on a widget — the surgical alternative to a bulk `update widgets`|
983
983
| Insert after |`insert after widgetName { widgets }`| Add widgets after target |
984
984
| Insert before |`insert before widgetName { widgets }`| Add widgets before target |
985
+
| Insert into |`insert into containerName { widgets }`| Append as the container's last child (fills an empty container; dataview children take its entity) |
985
986
| Drop widgets |`drop widget name1, name2`| Remove widgets by name |
0 commit comments