Package io.jmix.flowui.model
Interface ViewData
- All Known Implementing Classes:
ViewDataImpl
public interface ViewData
Interface defining methods for interacting with data API elements of a view.
-
Method Summary
Modifier and TypeMethodDescription<T extends InstanceContainer<?>>
TgetContainer
(String id) Returns a container by its id.Returns ids of all registered containers.Returns view'sDataContext
.Returns view'sDataContext
or null if it is not defined.<T extends DataLoader>
TReturns a loader by its id.Returns ids of all registered loaders.void
loadAll()
PerformsDataLoader.load()
for all loaders registered in the view.void
registerContainer
(String id, InstanceContainer<?> container) Registers the given container in the view.void
registerLoader
(String id, DataLoader loader) Registers the given loader in the view.void
setDataContext
(DataContext dataContext) SetsDataContext
instance for the view.
-
Method Details
-
getDataContext
DataContext getDataContext()Returns view'sDataContext
.- Throws:
IllegalStateException
- if the DataContext is not defined
-
getDataContextOrNull
Returns view'sDataContext
or null if it is not defined. -
setDataContext
SetsDataContext
instance for the view. -
loadAll
void loadAll()PerformsDataLoader.load()
for all loaders registered in the view. -
getContainer
Returns a container by its id.- Throws:
IllegalArgumentException
- if there is no such container in the view
-
getLoader
Returns a loader by its id.- Throws:
IllegalArgumentException
- if there is no such loader in the view
-
getContainerIds
Returns ids of all registered containers. -
getLoaderIds
Returns ids of all registered loaders. -
registerContainer
Registers the given container in the view. -
registerLoader
Registers the given loader in the view.
-