Welcome Guest Search | Active Topics | Sign In | Register

Looking for details on handling Javascript dialogs in EOWebView Options
PM
Posted: Thursday, December 22, 2016 2:00:10 PM
Rank: Newbie
Groups: Member

Joined: 12/22/2016
Posts: 2
Hello EO Support,

We are seeing some issues with the default Javascript dialog handling behavior (alert/confirm/prompt) where the dialog is not always visible to the users of our application, especially if they don't have the triggering WebView in focus at the time.

We have been looking at your documentation about customization of the dialog handling event (https://www.essentialobjects.com/doc/webbrowser/customize/js_dialog.aspx) and are wondering about the class "JSPrompt" that is referenced in the sample code - is this an EO class and if so, how can we use it in our custom handler?

It seems that the default implementations may not correctly anchor the MessageBox to the application window - we have noticed very strange behavior if the message box appears and then the EO control is disposed, which would suggest that the Window handle provided to MessageBox is somehow related to the EO control itself and not the main application window.

Have you seen this behavior and do you have any suggestions on how best to handle this? I can submit a test project with some details if it would be helpful to you.

Best,
Peter
eo_support
Posted: Thursday, December 22, 2016 3:32:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You can ignore the JSPrompt class and just use MessageBox. That way you can anchor it to whatever control/handle you want it to anchor. We do not explicitly pass a window handle to MessageBox ---- you can do so if you want to.

If you are curious about JSPrompt, you can find the full source code in the TabbedBrowser sample project. It's a WPF Window with a text and two buttons.

Thanks!
PM
Posted: Thursday, December 22, 2016 3:49:26 PM
Rank: Newbie
Groups: Member

Joined: 12/22/2016
Posts: 2
Thanks much for the quick reply, we'll check this out and report back if we continue to encounter issues.

Best,
Peter


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.