Welcome Guest Search | Active Topics | Sign In | Register

Need a way to close popup windows from javascript Options
ruk
Posted: Wednesday, August 8, 2018 2:17:05 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
One of our customers have JavaScript for opening and closing popups (sample below). When a popup is created we handle the WebView.NewWindow event and create a WPF popup window. Now from the JavaScript if this popup is closed, we need a way to close the popup. We couldn't find any event from WebView for popup close. Is there any way to do this? If not, can you add the capability to support this scenario?

Sample JavaScript:
<!doctype html>
<html>
<head><title>Test</title></head>
<body>

<input type="button" value="Popup" onclick="Open()" />
<input type="button" value="close" onclick="Close()" />

<script language="javascript">
function Open()
{
rtwin = window.open();
rtwin.document.write("<p>This is for Test</p>")
}
function Close()
{
rtwin.close();
}
</script>

</body>
</html>

ruk
Posted: Wednesday, August 8, 2018 2:50:40 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
We figured out how to do this. We subscribe the WebView closed event on the WebView corresponding to the popup window.
eo_support
Posted: Wednesday, August 8, 2018 3:43:15 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Great. Glad to hear that you got it working!


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.