Class CollectionLoader.PreLoadEvent<T>

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

public static class CollectionLoader.PreLoadEvent<T> extends EventObject
Event sent before loading entities.

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

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

  • Method Details

    • getSource

      public CollectionLoader<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.