Page 1 of 1

Closing Third-level Popup Browser Window Kills Second-level ChildForm/Window (PopupBrowser2)

Posted: Sat Jan 09, 2021 5:06 pm
by MTKor
Hello,

Thank you for your assistance so far, we have now proceeded using the PopupBrowser2 demo application as the basis for a tailor-made solution, got the zoom in/out functionality implemented and in general the popup windows are behaving nicely, too.

However, the testers have found a situation where a third-level popup browser window causes problems. The chain of events goes like this:

1. When the application is started and the user logs in (MainForm/ First level), the initially loaded URL automatically fires up a new browser window on the ChildForm/Second level.

2. The application has a specific feature (Child/Second level) by which the user has an option to open a new (Third-level) popup browser window in order to view some detailed data related to the Child/Second level.

3. When the user closes the Third-level popup browser window, it automatically causes the parent on the ChildForm/Second level window to close, too. This means that the user loses all data entered on the ChildForm/Second level, only the Third-level popup browser window should close and the ChildForm/Second level window should stay up/intact.

I would appreciate your advise on how this situation could be solved or avoided.

Re: Closing Third-level Popup Browser Window Kills Second-level ChildForm/Window (PopupBrowser2)

Posted: Sun Jan 10, 2021 11:33 am
by salvadordf
That problem can only appear when you let CEF create the child form instead of using custom Delphi/Lazarus forms with independent TChromium components.

Check that the TChromium.OnBeforePopup and TChromium.OnOpenUrlFromTab events in the Main and Child forms set the result to TRUE when targetDisposition is WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB or WOD_NEW_WINDOW.

If you copied the code in the TChromium.OnBeforePopup event then check that CreateClientHandler works correctly and returns TRUE.

Re: Closing Third-level Popup Browser Window Kills Second-level ChildForm/Window (PopupBrowser2)

Posted: Sun Jan 10, 2021 12:18 pm
by MTKor
Thank you for your reply, I will study these.

As an update, the behaviour is even stranger as I described earlier:

Trying to close the Third level popup browser window closes the Second level browser window, BUT does not not close the Third level browser window itself. Trying to close the Third level browser window a second time will finally cause it to close.

Re: Closing Third-level Popup Browser Window Kills Second-level ChildForm/Window (PopupBrowser2)

Posted: Sun Jan 10, 2021 3:14 pm
by salvadordf
I tested that scenario with 3 window levels and I couldn't reproduce this issue with the PopupBrowser2 demo.

Compare the code in your application with the code in the PopupBrowser2 demo.

Re: Closing Third-level Popup Browser Window Kills Second-level ChildForm/Window (PopupBrowser2)

Posted: Mon Jan 11, 2021 7:46 am
by MTKor
Hi,
I also tested it with the PopupBrowser2 demo application and the same thing happened as with our tailor-made application. The Second/Child level browser window was closed when trying to close the Third level popup window.

Maybe it is irrelevant, but this is a "isolated" Flash based application running the Second/Child level that generates on the Third level a HTML page containing summary information for the user to review.

I am trying to avoid having to implement a GrandChild level for this Third level functionality.