spring
spring copied to clipboard
@UIScoped view gets reinstantiated upon navigation
If a view is defined with @SpringView(name="view") and @UIScope, it still gets its constructor invoked every time the view is navigated into with navigator.navigateTo("view").
As this is @UIScoped it should use the same instance and provide same behaviour as what standard Navigator does when view is registered with instance, instead of type.
Hi, I had the same trouble... I thought, annotations don't have an order, but we fixed the problem by re-order the annotations.
Try to define first the scope and than the SpringView, that works fine to me.
@UIScope
@SpringView(name = "SampleView")
The reason for this issue is that @SpringView already includes @ViewScope (which overrides your @UIScope)
BTW @flo-ferox the order should be irrelevant and I would prefer an error or exception when multiple scopes are used (and in conflict) on the same component/bean
@ak99372 I agree, order should be irrelevant, but it wasn't for me. I could solve the problem by re-order the annotations. I also don't got an exception/conflict message.