Flow Dialog with @UIScope

We have a Flow Dialog in our application that uses the @UiScope annotation and a presenter for the dialog that also uses UIScope.
We have two methods that use @PostConstruct and @Predestroy in the presenter.
When we navigate to the location of the dialog @PostConstruct is called.
When we navigate away @PreDestroy is called.
When we navigate to the dialog again, @PostConstruct is not called again.

Im new to Vaadin and new to Spring. We want @PostConstruct to be called every time.
Does anyone know why this behaviour is caused?

Just a guess: looking at the documentation PreDestroy is not officially supported and therefore the instance is still available afterwards and PostConstruct not called again.

Thanks for the suggestion, what is the vaadin way of implementimg this behaviour?

We want @PostConstruct to be called every time.
Use @Scope(“prototype”) so the bean will be created everytime you inject it

It might be tricky if you save the dialog as an attribute of the class (then it has the same livecycle) or if you want to create it every time you open the dialog.

what is the vaadin way of implementimg this behaviour?
I don’t know what you want to put in the PostConstruct/PreDestroy so it’s hard to answer

We have an endpoint that distributes data to every dialog and they should register/deregister

You probably don’t need it when the dialog is closed so I would probably use the addOpenedChangeListener