Interface EntityView<T>

  • Type Parameters:
    T - the entity type
    All Superinterfaces:
    HasConfirmation, com.vaadin.flow.component.HasElement, HasNotifications, Serializable

    public interface EntityView<T>
    extends HasConfirmation, HasNotifications
    A master / detail view for entities of the type T. The view has a list of entities (the 'master' part) and a dialog to show a single entity (the 'detail' part). The dialog has two modes: a view mode and an edit mode.

    The view can also show notifications, error messages, and confirmation requests.

    • Method Detail

      • showError

        default void showError​(String message,
                               boolean isPersistent)
        Shows an error notification with a given text.
        Parameters:
        message - a user-friendly error message
        isPersistent - if true the message requires a user action to disappear (if false it disappears automatically after some time)
      • isDirty

        boolean isDirty()
        Returns the current dirty state of the entity dialog.
        Returns:
        true if the entity dialog is open in the 'edit' mode and has unsaved changes
      • clear

        void clear()
        Remove the reference to the entity and reset dirty status.
      • write

        void write​(T entity)
            throws com.vaadin.flow.data.binder.ValidationException
        Writes the changes from the entity dialog into the given entity instance (see Binder.writeBean(Object))
        Parameters:
        entity - the entity instance to save the changes into
        Throws:
        com.vaadin.flow.data.binder.ValidationException - if the values entered into the entity dialog cannot be converted into entity properties
      • getEntityName

        String getEntityName()
      • showCreatedNotification

        default void showCreatedNotification()
      • showUpdatedNotification

        default void showUpdatedNotification()
      • showDeletedNotification

        default void showDeletedNotification()