Search in sources :

Example 1 with ContainerValueSourceProvider

use of io.jmix.ui.component.data.value.ContainerValueSourceProvider in project jmix by jmix-framework.

the class FormLoader method loadDataContainer.

protected void loadDataContainer(Form resultComponent, Element element) {
    String containerId = element.attributeValue("dataContainer");
    if (!Strings.isNullOrEmpty(containerId)) {
        FrameOwner frameOwner = getComponentContext().getFrame().getFrameOwner();
        ScreenData screenData = UiControllerUtils.getScreenData(frameOwner);
        InstanceContainer container = screenData.getContainer(containerId);
        // noinspection unchecked
        resultComponent.setValueSourceProvider(new ContainerValueSourceProvider(container));
    }
}
Also used : ContainerValueSourceProvider(io.jmix.ui.component.data.value.ContainerValueSourceProvider) FrameOwner(io.jmix.ui.screen.FrameOwner) InstanceContainer(io.jmix.ui.model.InstanceContainer) ScreenData(io.jmix.ui.model.ScreenData)

Aggregations

ContainerValueSourceProvider (io.jmix.ui.component.data.value.ContainerValueSourceProvider)1 InstanceContainer (io.jmix.ui.model.InstanceContainer)1 ScreenData (io.jmix.ui.model.ScreenData)1 FrameOwner (io.jmix.ui.screen.FrameOwner)1