I'm having some issues using cdi observes in page annotated classes. It appears from the navigation code that before the page you are navigating to is shown, the current widget in the navigation content panel is cleared. This does not appear to always destroy the widget. Ig you have observer methods in the page class, they continue to get called unless they are destroyed by the bean manager, correct? Do I have something wrong with this scenario?
Thanks for any help with this issue.
This comes down to the same problem we have discussed here: Question on Instance and Destroy usage
We need to introduce the concept of a page scope in Errai. Until then the bean needs to be destroyed manually for the observers to get unsubscribed. So, there's nothing wrong with your approach.