Package io.jmix.ui.model
Interface KeyValueInstanceLoader
- All Superinterfaces:
DataLoader
- All Known Implementing Classes:
KeyValueInstanceLoaderImpl
Loads a single instance of
KeyValueEntity.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classEvent sent after successful loading of a KeyValueEntity instance and setting it to the container.static classEvent sent before loading a KeyValueEntity instance. -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener toKeyValueInstanceLoader.PostLoadEvent.Adds a listener toKeyValueInstanceLoader.PreLoadEvent.ReturnsValueLoadContextwhich is created by the parameters of this loader.Returns the container which accepts loaded entities.Returns a function which will be used to load data instead of standard implementation.Returns data store name.voidsetContainer(KeyValueContainer container) Sets the container which accepts loaded entities.voidsetLoadDelegate(Function<ValueLoadContext, KeyValueEntity> delegate) Sets a function which will be used to load data instead of standard implementation.voidsetStoreName(String name) Sets the data store name.Methods inherited from interface io.jmix.ui.model.DataLoader
getCondition, getDataContext, getHints, getParameter, getParameters, getQuery, load, removeParameter, setCondition, setDataContext, setHint, setParameter, setParameters, setQuery
-
Method Details
-
getContainer
KeyValueContainer getContainer()Returns the container which accepts loaded entities.- Specified by:
getContainerin interfaceDataLoader
-
setContainer
Sets the container which accepts loaded entities. -
createLoadContext
ValueLoadContext createLoadContext()ReturnsValueLoadContextwhich is created by the parameters of this loader. TheValueLoadContextcan be used withDataManagerto load data by the same conditions. -
getStoreName
String getStoreName()Returns data store name. -
setStoreName
Sets the data store name. By default, the main data store is used. -
getLoadDelegate
Function<ValueLoadContext,KeyValueEntity> getLoadDelegate()Returns a function which will be used to load data instead of standard implementation. -
setLoadDelegate
Sets a function which will be used to load data instead of standard implementation. -
addPreLoadListener
Adds a listener toKeyValueInstanceLoader.PreLoadEvent.You can also add an event listener declaratively using a controller method annotated with
Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(KeyValueInstanceLoader.PreLoadEvent event) { // handle event here }- Parameters:
listener- listener- Returns:
- subscription
-
addPostLoadListener
Adds a listener toKeyValueInstanceLoader.PostLoadEvent.You can also add an event listener declaratively using a controller method annotated with
Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(KeyValueInstanceLoader.PostLoadEvent event) { // handle event here }- Parameters:
listener- listener- Returns:
- subscription
-