PDA

View Full Version : Modal Pop-up Window reusing components issue



senchaer
24 Jun 2011, 2:43 PM
Hi,

I have a modal pop-up window in my extjs application. So I came across the the following issue:

I defined a formPanel component ABC, which contains some trigger fields() and grids. At the same time my modal pop-up window is reusing this formPanel ABC.

So I have this formPanel ABC on my main page and also I can click a button to open this pop-up window. If I open the pop-up window and meanwhile resize the main application window, it totally mess up the rendering on the pop-up window or the main application window. (those grids inside the formpanel are rendered incorrectly)

Does anyone know the possible reasons why this is happening? Is it an Extjs bug? Or I didn't reuse the components correctly? P.S. I didn't override destroy method on this formPanel ABC. I'm not sure if I need to do that since the Extjs has automatic garbage collection.

Thx
Leon

senchaer
24 Jun 2011, 2:50 PM
This situation only happens when the main page and the pop-up window are sharing the same components. It works fine if they respectively use different components.

senchaer
24 Jun 2011, 3:19 PM
Solve the issue by removing ids in some components. Defining ids seems pretty dangerous because it may end up having two components sharing the same ids. Or it will just create a singleton?