docbox docbox
  • About Mateu
  • Java
  • Kotlin
  • C#
  • Python
  • Design systems
  • Native
  • AI
GitHub repo
to navigate to select ESC to close
  • Create your project

    • Prerequisites
    • Springboot MVC
    • Springboot Webflux
    • Micronaut
    • Quarkus
    • Helidon MP
  • Components

    • Overview
    • Layouts
    • Forms
    • Grids
    • Actions
    • The component tree
    • Supported components
    • Client-side logic
  • Java

    • Getting started
    • Your first Mateu app with Spring Boot
    • Build a real CRUD with relationships
    • Apps and pages
    • Compose a shell with multiple services
    • Declarative vs fluent
    • State, actions and fields
    • Field stereotypes
    • Routing and parameters
    • Examples
    • Foreign keys and options
    • Best practices
    • Triggers and events
    • Microservices example
    • Validation
    • Advanced
    • Rules
    • A real CRUD example
    • Action behavior
    • Navigation and menus
    • Layout and composition
    • UI effects (messages and commands)
    • End-to-end example
  • Java
  • Java
  • Examples

On This Page
  1. Examples
    1. Counter
    2. Form
    3. Table
    4. CRUD

Examples

Counter

@UI("")
public class Counter {

  @ReadOnly
  int count = 0;

  @Button
  Runnable increment = () -> count++;

}

Form

@UI("")
public class PersonForm {

  String name;
  int age;

  @Button
  Runnable save = () -> {
    // persist data
  };

}

Table

@UI("")
public class Users {

  List<User> users = userService.findAll();

}

CRUD

You define:

  • fields
  • actions

Mateu generates:

  • forms
  • validation
  • interactions

Table of Contents

  1. Examples
    1. Counter
    2. Form
    3. Table
    4. CRUD