I am facing one very peculiar problem it seems with the PopUp's in Flex...I will try to explain in detail....
I have built one component which is a combination of several components....as shown below....
All my components contains repeaters used with in it...Now what I am doing is I am opening the Comparison.mxml component with in a popup using the
PopUpManager class....as shown below..
compPopUp = new Comparison();
PopUpManager.addPopUp(compPopUp , Application.application as DisplayObject, true);
//compPopUp = Comparison(PopUpManager.createPopUp(Application.application as DisplayObject,Comparison,true));
I have tried both PopUpManager.addPopUp() method and also PopUpManager.createPopUp() method....and I am removing my PopUp as PopUpManager.removePopUp(this); in my removePopUp() function....
Comparison.mxml (My Main component....)
So my problem now is I am opening my main component in a PopUp and after closing if I again try to open the PopUp the previous instance of my popUp is also being rendered and created...in the sense all the data(i.e; my dataproviders which are ArrayCollections I am using) are not emptied and still retain the values even after removing the PopUp and opening it again...
I tried to debug and found that the previous eventListeners and the data of my previous PopUp instance still remains and are not released from memory once I close the PopUp...
Say after I close my popup once and again if I try to open the PopUp the previous instance still remains in addition to my current instnce event listeners and data...
What I am expecting is once I close my popUp component all the references to the previous instance should be freed from memory and only the daa and eventListeners for the current instance should exist but it's not happening...so why...??
It seems to be a possible bug with PopUpManager class....
Can you please tell any one how can I overcome this problem..???
What I tried to figure out this problem is I tried to put an Alert in one funtcion and tried to open the PopUp ...So I got one Alert message and if I try to close the PopUp and open it again I got two alerts..and againg if I close and open it shows 3 alerts....and so on it goes....like that...
And it is taking much much time to open and load my data in the PopUp for the subsequent opening and closing of my PopUp ...
Have any one encountered this problem earliar...???
Thanks in advance,