Search in sources :

Example 1 with ScreenDataXmlLoader

use of io.jmix.ui.model.impl.ScreenDataXmlLoader in project jmix by jmix-framework.

the class FragmentLoader method loadDataElement.

protected void loadDataElement(Element element) {
    Element dataEl = element.element("data");
    if (dataEl == null) {
        return;
    }
    ScreenData hostScreenData = null;
    ComponentContext parent = getComponentContext().getParent();
    while (hostScreenData == null && parent != null) {
        hostScreenData = parent.getScreenData();
        parent = parent.getParent();
    }
    ScreenDataXmlLoader screenDataXmlLoader = applicationContext.getBean(ScreenDataXmlLoader.class);
    ScreenData screenData = UiControllerUtils.getScreenData(resultComponent.getFrameOwner());
    screenDataXmlLoader.load(screenData, dataEl, hostScreenData);
    ((ComponentLoaderContext) context).setScreenData(screenData);
}
Also used : Element(org.dom4j.Element) ScreenDataXmlLoader(io.jmix.ui.model.impl.ScreenDataXmlLoader) ScreenData(io.jmix.ui.model.ScreenData)

Example 2 with ScreenDataXmlLoader

use of io.jmix.ui.model.impl.ScreenDataXmlLoader in project jmix by jmix-framework.

the class WindowLoader method loadScreenData.

protected void loadScreenData(Window window, Element element) {
    Element dataEl = element.element("data");
    if (dataEl != null) {
        ScreenDataXmlLoader screenDataXmlLoader = applicationContext.getBean(ScreenDataXmlLoader.class);
        ScreenData screenData = UiControllerUtils.getScreenData(window.getFrameOwner());
        screenDataXmlLoader.load(screenData, dataEl, null);
        ((ComponentLoaderContext) context).setScreenData(screenData);
    }
}
Also used : Element(org.dom4j.Element) ScreenDataXmlLoader(io.jmix.ui.model.impl.ScreenDataXmlLoader) ScreenData(io.jmix.ui.model.ScreenData)

Aggregations

ScreenData (io.jmix.ui.model.ScreenData)2 ScreenDataXmlLoader (io.jmix.ui.model.impl.ScreenDataXmlLoader)2 Element (org.dom4j.Element)2