Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 1.41 KB

File metadata and controls

60 lines (47 loc) · 1.41 KB

CRUD Pages

This tutorial shows how to create overview and edit pages for your entities.

Prerequisites

Run scripts/02-create-entity.mdl first to create the Task and Category entities.

Create an Overview Page

An overview page lists entities in a data grid:

mxcli -p App.mpr -c "
CREATE PAGE MyFirstModule.Task_Overview
(
    Title: 'Tasks',
    Layout: Atlas_Web_Content.Atlas_Default
)
{
    LAYOUTGRID mainGrid {
        ROW row1 {
            COLUMN col1 (DesktopWidth: 12) {
                DYNAMICTEXT heading (Content: 'Task Overview', RenderMode: H2)
            }
        }
        ROW row2 {
            COLUMN col2 (DesktopWidth: 12) {
                DATAGRID dgTasks (
                    DataSource: MICROFLOW MyFirstModule.DS_GetOpenTasks
                ) {
                    COLUMN colTitle (Attribute: Title, Caption: 'Title')
                    COLUMN colStatus (Attribute: Status, Caption: 'Status')
                    COLUMN colDueDate (Attribute: DueDate, Caption: 'Due Date')
                }
            }
        }
    }
};
"

Describe a Page

See the MDL definition of any page:

mxcli -p App.mpr -c "DESCRIBE PAGE MyFirstModule.Task_Overview"

Run the Full Example

mxcli exec scripts/04-create-page.mdl -p App.mpr

Next Steps