Class KeyValueInstanceLoader.PreLoadEvent

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

public static class KeyValueInstanceLoader.PreLoadEvent extends EventObject
Event sent before loading a KeyValueEntity instance.

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

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

  • Method Details

    • getSource

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