Skip to content

Reusable fields

Miguel Pérez Colom edited this page Oct 11, 2024 · 3 revisions

Sometimes you have a field which is not a basic field and which is repeated many times in your UI. In my case it uses to be a field for letting he user choose a reference to an entity (e.g. a Customer, a Product, a Service, ...).

When that happens you want to just add a custom field type to your form. Something like:

public class CreateBookingForm {

  CustomerRef customer;

  ServiceRef service;

  LocalDate startDate;

  LocalDate endDate;

  @TextArea
  String comments;

}

Where CustomerRef and ServiceRef are some kind of complex fields to allow the user to choose/add/edit from the existing entities from the database (or an external micro service accessed using rest apis).

TBC

Clone this wiki locally