Reusable fields - miguelperezcolom/mateu GitHub Wiki
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