Hello,
on my project, I open WPF window with EO WebBrowser control - on this control I set the url to html page.
<Window x:Class="Astea.AddressMaps.AddressMap"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:eo="http://schemas.essentialobjects.com/wpf/"
Title="AddressMap" Height="650" Width="1200">
<eo:WebControl>
<eo:WebControl.WebView>
<eo:WebView x:Name="mainWebView">
</eo:WebView>
</eo:WebControl.WebView>
</eo:WebControl>
</Window>
public AddressMap(string sessionID, string url)
{
_sessionId = sessionID;
InitializeComponent();
InitializeDialogWindow();
mainWebView.LoadCompleted += mainWebView_LoadCompleted;
mainWebView.JSExtInvoke += new JSExtInvokeHandler(WebView_JSExtInvoke);
mainWebView.Url = url;
mainWebView.Closed += mainWebView_Closed;
}
void mainWebView_LoadCompleted(object sender, EO.WebBrowser.LoadCompletedEventArgs e)
{
var Jobj = mainWebView.GetDOMWindow();
Jobj.InvokeFunction("MapAddressLoad", _sessionId);
}
Behind this html page I have javascript code.
on LoadCompleted event I call to function "MapAddressLoad" (defined in js) by invokeFunction.
In first time I open the wpf window - evrything is working OK and function is invoked correctly. but when I
close the window and
reopen it I get the error:
http://dsev2ctxastea27.il.astea.org/AsteaAllianceCurrent/App_includes/google_address_finder.js, line 44, col 4 - 5: Uncaught ReferenceError:
SetGlobalVar is not defined at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at EO.Base.BaseException..ctor(String lsy, Exception lsz)
at EO.WebBrowser.JSInvokeException..ctor(JSInvokeResult wx, String wy)
at EO.WebBrowser.JSException..ctor(String xa, Int32 xb, Int32 xc, Int32 xd, String xe)
at EO.WebBrowser.JSException.xmbk(yrnx wz)
at EO.WebBrowser.WebView.alzf(String go, JSInvokeResult gp, yrnx gq, Exception& gr)
at EO.WebBrowser.ScriptCall.dcpz(JSInvokeResult ye, qscn yf, String yg)
at EO.WebBrowser.ScriptCall.doyx.ymgi(qscn yj)
at EO.Internal.qsge`3.frre.orca(m ope)
at EO.Internal.qsge`3.nrxm(m onx)
at EO.Internal.yrni.dkho(Object gc)
at EO.Internal.qsge`3.nrxl()
at EO.Internal.qsge`3.nrxk(IntPtr onv, Int32 onw)
at EO.Internal.qsge`3.frrd.xlcv(qsao oot)
at EO.Internal.qsge`3.frrd.mkdt(Object oos)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
SetGlobalVar is called from invoked function MapAddressLoad and it seems that after the window is closed and reopened this function is not found anymore.
Do you have an idea why?