Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pages

Pages define the user interface of a Mendix application. Each page consists of a widget tree arranged within a layout, with data sources that connect widgets to the domain model.

Core Concepts

ConceptDescription
LayoutA reusable page template that defines content regions (e.g., header, sidebar, main content)
Widget treeA hierarchical structure of widgets that defines the page’s visual content
Data sourceDetermines how a widget obtains its data (page parameter, database query, microflow, etc.)
Widget nameEvery widget has a unique name within the page, used for ALTER PAGE operations

CREATE PAGE

The basic syntax for creating a page:

CREATE [OR REPLACE] PAGE <Module>.<Name>
(
  [Params: { $Param: Module.Entity [, ...] },]
  Title: '<title>',
  Layout: <Module.LayoutName>
  [, Folder: '<path>']
)
{
  <widget-tree>
}

Minimal Example

CREATE PAGE MyModule.Home
(
  Title: 'Welcome',
  Layout: Atlas_Core.Atlas_Default
)
{
  CONTAINER cMain {
    DYNAMICTEXT txtWelcome (Content: 'Welcome to the application')
  }
}

Page with Parameters

Pages can receive entity objects as parameters from the calling context:

CREATE PAGE MyModule.Customer_Edit
(
  Params: { $Customer: MyModule.Customer },
  Title: 'Edit Customer',
  Layout: Atlas_Core.PopupLayout
)
{
  DATAVIEW dvCustomer (DataSource: $Customer) {
    TEXTBOX txtName (Label: 'Name', Attribute: Name)
    TEXTBOX txtEmail (Label: 'Email', Attribute: Email)
    FOOTER footer1 {
      ACTIONBUTTON btnSave (Caption: 'Save', Action: SAVE_CHANGES, ButtonStyle: Primary)
      ACTIONBUTTON btnCancel (Caption: 'Cancel', Action: CANCEL_CHANGES)
    }
  }
}

Page Properties

PropertyDescriptionExample
ParamsPage parameters (entity objects passed in)Params: { $Order: Sales.Order }
TitlePage title shown in the browser/tabTitle: 'Edit Customer'
LayoutLayout to use for the pageLayout: Atlas_Core.PopupLayout
FolderOrganizational folder within the moduleFolder: 'Pages/Customers'
VariablesPage-level variables for conditional logicVariables: { $show: Boolean = 'true' }

Layouts

Layouts are referenced by their qualified name (Module.LayoutName). Common Atlas layouts include:

LayoutUsage
Atlas_Core.Atlas_DefaultFull-page layout with navigation sidebar
Atlas_Core.PopupLayoutModal popup dialog
Atlas_Core.Atlas_TopBarLayout with top navigation bar

DROP PAGE

Removes a page from the project:

DROP PAGE MyModule.Customer_Edit;

Inspecting Pages

Use SHOW and DESCRIBE to examine existing pages:

-- List all pages in a module
SHOW PAGES IN MyModule;

-- Show the full MDL definition of a page (round-trippable)
DESCRIBE PAGE MyModule.Customer_Edit;

The output of DESCRIBE PAGE can be used as input to CREATE OR REPLACE PAGE for round-trip editing.

See Also