一键导入
master-detail-pages
Build master-detail UI pages in Mendix MDL using Gallery selection binding and DataView with SELECTION source
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build master-detail UI pages in Mendix MDL using Gallery selection binding and DataView with SELECTION source
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Mendix MDL authoring, project navigation, and Docker app lifecycle — entities, microflows, pages, security, navigation, OQL, REST, testing, linting, and migration. Load when working in any Mendix codebase.
MDL Agent Documents — CREATE MODEL, CREATE KNOWLEDGE BASE, CREATE CONSUMED MCP SERVICE, CREATE AGENT syntax and calling agents from microflows
ALTER PAGE / ALTER SNIPPET — SET, INSERT, DROP, REPLACE widget operations on existing pages and snippets
Migration Assessment — structured investigation of non-Mendix projects for migration planning across technology stack, data model, business logic, UI, integrations, and security
Assess Mendix Project Quality — automated linting, catalog queries, naming conventions, security, maintainability, performance, and architecture review with scored report
Browse Integration Services and Contracts — SHOW/DESCRIBE OData, REST, business event, and database connection services; query MDL CATALOG integration tables; import external entities
| name | master-detail-pages |
| description | Build master-detail UI pages in Mendix MDL using Gallery selection binding and DataView with SELECTION source |
| compatibility | opencode |
<mdl_syntax>
create page Module.Entity_MasterDetail
(
title: 'Entity Master-Detail',
layout: Atlas_Core.Atlas_Default
)
{
layoutgrid mainGrid {
row row1 {
-- Master list (4 columns)
column colMaster (desktopwidth: 4) {
gallery entityList (datasource: database Module.Entity, selection: single) {
template template1 {
dynamictext name (content: '{1}', contentparams: [{1} = Name], rendermode: H4)
}
}
}
-- Detail form (8 columns)
column colDetail (desktopwidth: 8) {
dataview entityDetail (datasource: selection entityList) {
textbox txtName (label: 'Name', attribute: Name)
footer footer1 {
actionbutton btnSave (caption: 'Save', action: save_changes, buttonstyle: success)
}
}
}
}
}
}
gallery widgetName (
datasource: database from Module.Entity sort by Name asc,
selection: single|multiple|none
) {
template template1 {
-- Widgets for each item
dynamictext name (content: '{1}', contentparams: [{1} = AttrName], rendermode: H4)
}
}
Properties:
datasource: database from entity sort by attr asc|desc - Entity data source with optional sortingselection: single - Selection mode (Single for master-detail)dataview widgetName (datasource: selection sourceWidgetName) {
-- Form widgets
}
The selection source creates a binding to another widget's selection. When the user selects an item in the Gallery, the DataView displays that item.
listview widgetName (datasource: database Module.Entity, PageSize: 10) {
template template1 {
-- Widgets for each associated item
}
}
Used inside the detail form to show related/associated data.
Nested list by association: Use datasource: $currentObject/Module.Assoc (or the explicit datasource: association path form) inside a parent DATAVIEW. Both forms produce the same BSON (ByAssociation data source). Example: datagrid lines (datasource: $currentObject/Order_OrderLine) inside a dataview dv (datasource: database Order).
</mdl_syntax>
<complete_example>
create page CRM.Customer_MasterDetail
(
title: 'Customer Management',
layout: Atlas_Core.Atlas_Default
)
{
layoutgrid mainGrid {
row row1 {
column colMaster (desktopwidth: 4) {
dynamictext heading (content: 'Customers', rendermode: H3)
gallery customerList (datasource: database from CRM.Customer sort by Name asc, selection: single) {
template template1 {
dynamictext name (content: '{1}', contentparams: [{1} = Name], rendermode: H4)
dynamictext email (content: '{1}', contentparams: [{1} = Email])
}
}
}
column colDetail (desktopwidth: 8) {
dataview customerDetail (datasource: selection customerList) {
dynamictext detailHeading (content: 'Customer Details', rendermode: H3)
textbox txtName (label: 'Name', attribute: Name)
textbox txtEmail (label: 'Email', attribute: Email)
textbox txtPhone (label: 'Phone', attribute: Phone)
footer footer1 {
actionbutton btnSave (caption: 'Save', action: save_changes, buttonstyle: success)
actionbutton btnCancel (caption: 'Cancel', action: cancel_changes)
}
}
}
}
}
}
</complete_example>
<key_patterns>
The core of master-detail is the selection binding:
selection: single - enables single item selectiondatasource: selection galleryName - listens to Gallery selectionThe selection binding uses widget names to connect:
customerListdatasource: selection customerListInside Gallery templates, use contentparams to reference current item attributes:
template template1 {
dynamictext name (content: '{1}', contentparams: [{1} = Name], rendermode: H4)
dynamictext email (content: '{1}', contentparams: [{1} = Email])
}
</key_patterns>
<syntax_summary>
| Element | Syntax |
|---|---|
| Page properties | (title: 'title', layout: Module.Layout) |
| Widget name | Required after type: gallery myGallery (...) |
| Database source | datasource: database from Module.Entity |
| Selection binding | datasource: selection widgetName |
| Sort by | datasource: database from entity sort by Name asc |
| Where filter | datasource: database from entity where [IsActive = true] |
| Selection mode | selection: single |
| Attribute binding | attribute: attributename |
| Action binding | action: save_changes |
| Button style | buttonstyle: success |
| Text content | content: 'text' with contentparams: [{1} = attr] |
| Render mode | rendermode: H4 |
| Template content | template template1 { ... } |
| </syntax_summary> |
<implementation_notes>
ListenTargetSource in the Model SDK(key: value) syntax
</implementation_notes><output_rules>Output MDL code only in code blocks. Keep explanations concise.</output_rules>