Wednesday, August 6, 2008

Unregister your Mediators after popupmanager.remove();

I had a strange behavior today with my pure MVC where i had spent couple of hours analyzing what was going wrong. I had a grouping collection for my Advanced datagrid that groups based on the customer name, where the list of passes vary depending on the pass types. The best way to do this type of scenario is to group the search results based on the customer name and show the varied number of entries in the customer name based on the pass types available. All the while i had been refreshing my grouping collection source but i completely missed that the creation complete checks to see if i already have the mediator registered but the reference to the window created by the popup manager is generated every time newly but the mediator will be pointing (registered and listening) to a old pop up thats still not garbage collected. Always ensure to unregister your mediators after the use !! that would solve a lot of problems.