Welcome Guest Search | Active Topics | Sign In | Register

webbrowser New Window with Form values Options
nomdeplume
Posted: Monday, October 20, 2014 2:43:58 PM
Rank: Newbie
Groups: Member

Joined: 10/15/2014
Posts: 8
What is the proposed method for handling a form page that references itself, maintaining state, but giving different views based on that state?

Setting the e.webview to the current webcontrol.webview doesn't seem to work. Setting the .url doesn't work either. .Accept = true seems to work as much as it breaks.

I can get a popup and/or tab to work, but for some reason I lose the new window click event on the 'parent' page, actually I lose everything on that page, even typing a new URL doesn't purge it's 'state'.

Some code examples related to this page, might be a great help.
http://www.essentialobjects.com/doc/6/advanced/new_window.aspx
Outside of the 'TabBrowser' example, which doesn't help me either. Matter of fact, this little snippet of information DOES NOT work....

//If you do not want to open a new window but wish to open
//the new Url in the same window, comment the code above
//and uncomment the code below. The code below set the existing
//WebView's Url to the new Url. Also because it did not set
//e.Accepted to true, so the new WebView will be discarded.
EO.WebBrowser.WebView webView = (EO.WebBrowser.WebView)sender;
webView.Url = e.TargetUrl;
eo_support
Posted: Monday, October 20, 2014 10:02:40 PM
Rank: Administration
Groups: Administration

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

You will need to maintain multiple WebControl/WebView ---- for a Windows Form application, you should always keep the WebControl/WebView to a one to one pair. For example, if you need two WebViews, do not try to use one WebControl and then switch WebView by setting the WebControl's WebView property. Instead you should keep two WebControls and two WebViews. When you need a new WebView, create a new WebControl and a new WebView and set the WebControl's WebView property to the newly created WebView. From this moment on these two should be tied together. Syntactically WebControl does allow you to switch WebView at runtime, but switching in a new WebView automatically destroys the old WebView, so it's probably not something you wanted.

The NewWindow event sample code in the TabbedBrowser is actually quite sufficient. Particularly you need to:

1. You MUST create a new WebControl to "accept" the newly created WebView. This is already explained above;
2. You MUST NOT set the new WebView's Url. The browser engine will wait for you to "accept" this new WebView and proceed to load the Url;
3. You MUST hook up all event handlers with the new WebView. The new WebView does not automatically inherits the old WebView's event handlers;

Hope this helps. Please feel free to let us know if you still have any questions.

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.