2025-03-20, 16:21:40
For anybody else reading this. The issue has been resolved.
The navigation that caused the issue was indirect by triggering a javascript click event from calling ElementClickByQuerySelectorSync.
Because the synchronized method was used, the OnNewWindowRequested event was not getting triggered.
By using the ElementClickByQuerySelector method instead, things started to work as expected and the creation of the new window could now be stopped.
FWIW, we used the following in the OnNewWindowRequested event.
As you can see here, the method to get the current URI and then use method navigate is not used, but instead we tell the OnNewWindowRequested event to re-use the existing AntView object for the "New Window" by assiging it to NewWindowDispatch. Both methods work with tiny differences.
If you navigate explicitly then you get to keep navigation history and the "back button" will work.
If you assign the current AntView object as the "new window" then your navigation history is gone and there will be no "back button".
Btw, the back button here is the "Back" option in the context (right click) menu.
--
Wil
The navigation that caused the issue was indirect by triggering a javascript click event from calling ElementClickByQuerySelectorSync.
Because the synchronized method was used, the OnNewWindowRequested event was not getting triggered.
By using the ElementClickByQuerySelector method instead, things started to work as expected and the creation of the new window could now be stopped.
FWIW, we used the following in the OnNewWindowRequested event.
Code:
*** ActiveX Control Event ***
LPARAMETERS args
lcURL = ""
Args.Handled = .t.
lcURL = Args.URI
Thisform.currenturl1 = Args.URI
Args.NewWindowDispatch (thisform.oAntview1.object)
If you navigate explicitly then you get to keep navigation history and the "back button" will work.
If you assign the current AntView object as the "new window" then your navigation history is gone and there will be no "back button".
Btw, the back button here is the "Back" option in the context (right click) menu.
--
Wil