Class StandardEditor.InitEntityEvent<E>

java.lang.Object
java.util.EventObject
io.jmix.ui.screen.StandardEditor.InitEntityEvent<E>
Type Parameters:
E - type of entity
All Implemented Interfaces:
Serializable
Enclosing class:
StandardEditor<T>

@TriggerOnce public static class StandardEditor.InitEntityEvent<E> extends EventObject
Event sent before the new entity instance is set to edited entity container.

Use this event listener to initialize default values in the new entity instance, for example:

     @Subscribe
     protected void onInitEntity(InitEntityEvent<Foo> event) {
         event.getEntity().setStatus(Status.ACTIVE);
     }
 
See Also:
  • Field Details

    • entity

      protected final E entity
  • Constructor Details

    • InitEntityEvent

      public InitEntityEvent(Screen source, E entity)
  • Method Details

    • getSource

      public Screen getSource()
      Overrides:
      getSource in class EventObject
    • getEntity

      public E getEntity()
      Returns:
      initializing entity