Skip to content

Master-detail (Process + Steps)

A master-detail UI in Mateu is built by embedding a child CRUD orchestrator inside a parent screen, not by using List<Entity>.

The pattern applies to any parent-child relationship: Order + OrderLines, Customer + Contacts, Project + Tasks. This page uses a Process + Steps example to show the mechanics clearly. The golden example applies the same pattern to Orders and OrderLines with a full backend stack.


We want:

  • a Process (parent)
  • a list of Steps (children)
  • full CRUD on Steps inside the Process screen

@Route("/processes/:id")
@Style(StyleConstants.CONTAINER)
public class ProcessPage {
String id;
String name;
Callable<?> steps = () -> MateuBeanProvider
.getBean(Steps.class)
.withProcessId(id);
}
  • steps is NOT List<Step>
  • it is a dynamic UI block
  • resolved after the viewmodel is hydrated

public class Steps extends AutoListOrchestrator<Step> {
String processId;
public Steps withProcessId(String processId) {
this.processId = processId;
return this;
}
}

record Step(
String id,
String processId,
String name
) {}

Inside the Process screen:

  • list of steps
  • create step
  • edit step
  • delete step

All scoped by processId


This is preferred over:

List<Step> steps;

Because:

  • List<Step> becomes a simple editable structure
  • it does NOT provide full CRUD behavior
  • it couples UI to domain structure

flowchart TD
P["ProcessPage\nid · name · Callable&lt;?&gt; steps"]
P -->|resolves after hydration| S["Steps\nextends AutoListOrchestrator&lt;Step&gt;\nscoped by processId"]
S --> CR["Full CRUD on Step\nlist · create · edit · delete"]
  • parent → state + composition
  • child → independent CRUD
  • composition → Callable<?>

Use this pattern when:

  • child entities have their own lifecycle
  • you need CRUD inside another screen
  • you want explicit control over data boundaries

  • do NOT model child collections as List<Entity>
  • use embedded orchestrators instead
  • compose using Callable<?>

This is the Mateu way to build master-detail UIs.