Welcome Guest Search | Active Topics | Sign In | Register

Webview JS accessing window.opener Options
Scott
Posted: Thursday, November 19, 2015 2:09:58 PM
Rank: Newbie
Groups: Member

Joined: 11/19/2015
Posts: 2
I'm using the Webviewer to access a web application to view messages from the web app.

The way the pages work, they have a list of messages, and when you open a messages it opens it in a new window, which is working correctly using the webviewer. The problem is that the message page has a couple of buttons like a 'Next' button that calls back to the opening page (message center) and gets the information to open the next message.

Unfortunately, after opening a new window (not just a new tab), the page can't send a command to the parent. In this particular case, the command might be "window.opener.getNextUrl();"

This fails since it's a new window. Does anyone have any recommendations?
eo_support
Posted: Thursday, November 19, 2015 2:13:32 PM
Rank: Administration
Groups: Administration

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

I am not sure if I understand your question correctly. If this is a generic JavaScript/web page programming question or it is something specifically related to our product? The reason we ask is we do not provide support on generic programming questions.

Thanks!
Scott
Posted: Thursday, November 19, 2015 2:22:05 PM
Rank: Newbie
Groups: Member

Joined: 11/19/2015
Posts: 2
I'm trying to provide a quick interface from a windows form app using the webview control to display the users "Message Center" inside the webview control on a form. The reason for this is to keep it a standard viewer that we can use without having to deal with the multitude of browsers that clients use as a default.

The javascript has been running on the web application for years. I'm just now trying to implement this using the EO Webviewer control.

The issue is when the "Message Center" uses a window.open script to open a specific message, the new window can't seem to reference back to the source window it was opened from.

Here is the code we use to open the new window (on the windows form)

private void webView2_NewWindow(object sender, EO.WebBrowser.NewWindowEventArgs e)
{
Form1 oForm = new Form1();
oForm.Navigate_To(e.TargetUrl);
oForm.setSize((int)e.Width, (int)e.Height);
oForm.Show();
}


and the page that it opens attempts to use a command like "window.opener.getNext();", but window.opener=null.

I'm guessing there is a reference that needs to be made between the two forms, but can't find anything in your documentation.


eo_support
Posted: Thursday, November 19, 2015 2:29:11 PM
Rank: Administration
Groups: Administration

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

Your code in NewWindow is wrong. You can not create a new WebView in this case. You must "place" e.WebView in your Form instead. Only that WebView's opener points to the original WebView. The new WebView you created would have nothing to do with the original WebView. See here for more details:

http://www.essentialobjects.com/doc/webbrowser/advanced/new_window.aspx

You can also take a look of our TabbedBrowser sample application's NewWindow implementation to get an idea of how this works.

Thanks!


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.