Hello,
I would like to write a mixin which, under certain conditions, adds a fragment to the screen.
Source Code:
@Subscribe
default void initBanner(Screen.BeforeShowEvent event) {
BeanLocator beanLocator = Extensions.getBeanLocator(event.getSource());
UiComponents uiComponents = beanLocator.get(UiComponents.class);
Fragments fragments = beanLocator.get(Fragments.class);
...
}
Unfortunately I get the message “NoSuchBeanDefinitionException: No qualifying bean of type ‘com.haulmont.cuba.gui.Fragments’ available”.
What do I have to do to get an instance, or is there an alternative way to add fragments through a mixin?
Thanks and best regards
Andreas