Class InstanceLoader.PreLoadEvent<T>

java.lang.Object
java.util.EventObject
io.jmix.flowui.model.InstanceLoader.PreLoadEvent<T>
All Implemented Interfaces:
Serializable
Enclosing interface:
InstanceLoader<E>

public static class InstanceLoader.PreLoadEvent<T> extends EventObject
Event sent before loading an entity instance.

You can prevent load using the preventLoad() method of the event, for example:

     @Subscribe(id = "fooDl", target = Target.DATA_LOADER)
     private void onFooDlPreLoad(InstanceLoader.PreLoadEvent event) {
         if (doNotLoad()) {
             event.preventLoad();
         }
     }
 
See Also:
  • Constructor Details

  • Method Details

    • getSource

      public InstanceLoader<T> getSource()
      The data loader which sent the event.
      Overrides:
      getSource in class EventObject
    • getLoadContext

      public LoadContext<T> getLoadContext()
      Returns the load context of the current data loader.
    • preventLoad

      public void preventLoad()
      Invoke this method if you want to abort the loading.
    • isLoadPrevented

      public boolean isLoadPrevented()
      Returns true if preventLoad() method was called and loading will be aborted.