Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

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

Post Reply
MTKor
Posts: 7
Joined: Thu Nov 12, 2020 7:25 am

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

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
MTKor
Posts: 7
Joined: Thu Nov 12, 2020 7:25 am

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

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post 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.
MTKor
Posts: 7
Joined: Thu Nov 12, 2020 7:25 am

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

Post 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.
Post Reply