Welcome Guest Search | Active Topics | Sign In | Register

Problem with webView_NewWindow handler Options
Kyriakos
Posted: Friday, February 13, 2015 10:14:19 AM
Rank: Newbie
Groups: Member

Joined: 2/13/2015
Posts: 5
Hello

We have a wpf application and we have a weird behaviour in different windows OS, when from our first webview we try to open a new window with a new webview (meaning the site from the first webview calls a web_view_NewWindow handler).
Our problem is particular when the new webview is expected to load pdf responses(but can appear in html responses too).

We try different approaches in coding. The problem seems to be in the web_view_NewWindow handler.

->First we try to make a [newWindow.gridMain.Children.Add(newWebControl)]

In windows xp if we add [e.Accepted = true] then the whole application halts.
In windows8 32bit the new window never loads.
In windows7 64bit everything works fine.

->Second we try to have a xaml inside of which we have a webview(in xaml too) and from the web_view_NewWindow we just
show the new window and change the webview's url.

if we add [e.Accepted = true] then in windows7 the new webview never load.So we skipped it.
Our code now is
PdfWindow newWindow = new PdfWindow();
newWindow.wc.WebView.Activate += new EventHandler(web_view_Activate);
newWindow.wc.WebView.Url = e.TargetUrl;
newWindow.Show();

Unfortunately,
In windows XP most of the times the 2nd webview does not load the url and we see a white screen.But newer halts the application as before.
In windows7 64 bit everything works fine.
In windows7 32 bit some times the 2nd webview does not load the url and we see a white screen.
In windows8 everything works fine.


Any ideas?

Thank you in advance,
Kyriakos

eo_support
Posted: Friday, February 13, 2015 10:28:13 AM
Rank: Administration
Groups: Administration

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

The rule for NewWindow is if you set e.Accepted to true, then you MUST display e.WebView. You can not create a new WebView to display the Url, nor can you change e.WebView.Url. In the sample code you provided, you created a new WebView (when you create a new PdfWindow) and you use the new WebView to display e.TargetUrl. This is wrong. You must put e.WebView into your window (by calling newWindow.wc.WebView = e.WebView).

Thanks!
Kyriakos
Posted: Friday, February 13, 2015 10:46:42 AM
Rank: Newbie
Groups: Member

Joined: 2/13/2015
Posts: 5
We change our code in the event handler to:

e.Accepted = true;
PdfWindow newWindow = new PdfWindow();
newWindow.wc.WebView.Activate += new EventHandler(web_view_Activate);
newWindow.wc.WebView = e.WebView;
newWindow.Show();

but as i mentioned earlier in windows xp we have the same problem. If i skip the e.Accepted = true then i have the same problem in windows7.

I can provide you with a sample project if necessary.

Thank you for your immediate response earlier
eo_support
Posted: Friday, February 13, 2015 11:11:42 AM
Rank: Administration
Groups: Administration

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

You can try to run our TabbedBrowser sample in XP and see if it works. That sample handles NewWindow event. We do not officially support XP since it's a 13 year old OS and Microsoft has ended XP's extended support last year.

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.