Class KeyValueCollectionLoader.PreLoadEvent

java.lang.Object
java.util.EventObject
io.jmix.ui.model.KeyValueCollectionLoader.PreLoadEvent
All Implemented Interfaces:
Serializable
Enclosing interface:
KeyValueCollectionLoader

public static class KeyValueCollectionLoader.PreLoadEvent 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(KeyValueCollectionLoader.PreLoadEvent event) {
         if (doNotLoad()) {
             event.preventLoad();
         }
     }
 
See Also:
  • Constructor Details

  • Method Details

    • getSource

      public KeyValueCollectionLoader getSource()
      The data loader which sent the event.
      Overrides:
      getSource in class EventObject
    • getLoadContext

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