-
1. Re: Question on Instance and Destroy usage
csa Dec 12, 2013 9:08 PM (in response to jdestef)Hi John,
Yes, using Instance<T>/Disposer<T> for creating/destroying beans manually is the right approach here to make sure your observers are unsubscribed and all the lifecycle methods get called.
Errai could do this automatically when we introduce additional scopes (e.g. a page scope). This is on our road map. If you have suggestions/ideas please let us know.
Cheers,
Christian
-
2. Re: Question on Instance and Destroy usage
jdestef Dec 15, 2013 12:28 PM (in response to csa)Hi Christian,
Even with the ListWidget I think there are still many occasions where using Instance as a factory is useful. In the app I'm working on I have page annotated classes with injected components. In some of the components I'm using Instance to create additional widgets of the same type to add to different parts of the page. It would be great if if there was a context for page that would clean up all of the created objects within this scenario.
Thanks