I use vaadin-spring. I created public abstract class AbstractBasicVerticalLayoutWithMenu extends HorizontalLayout implements View
and I have two normal classes extending it. In abstract class I @Autowire
Menu component defined:
@UIScope
@SpringComponent
public class Menu extends CssLayout
both classes are annotated
@UIScope
@SpringView
I have very strange issue in one of views, that my menu component is not being displayed.
I did some digging and added logging. On
@Override
public void enter(ViewChangeEvent event)
method I added logging and tried many thigs and I found that when I do this.getComponentIndex(menu)
that wrong view component has index -1!
Interesting thing is that if I remove correctly displayed view from navigator (i do it: getNavigator().addView(FirstTesterView.VIEW_NAME, firstTesterView);
) then this incorrect view is back to correct.
I have no idea why, but it looks like only first of instantiated classes extending acstract gets @Autowired component but not next.
What do I do wrong?