Welcome Guest Search | Active Topics | Sign In | Register

EO Webview RegisterJSExtensionFunction call back do not have passed data Options
Tank
Posted: Friday, April 14, 2017 5:22:09 AM
Rank: Advanced Member
Groups: Member

Joined: 6/13/2014
Posts: 38
Hi There,

i have registered a js function on EO web viewer using RegisterJSExtensionFunction and calling this from web to pass data to window form application.

but some times for weired reasons passed arguments are not in parameter.

WebViewMain.RegisterJSExtensionFunction("MyFun", JSCallbackFunction);

private void JSFunctionCallBack(object sender, JSExtInvokeArgs e)
{
if (e.Arguments.Length > 0 && e.Arguments[0] is JSObject)
{
string val = e.Arguments[0][sEventDataKey] as string;
val <--- here val is always empty..
}
}


if i pass JSON then also some properties are always empty.

Please help.

Regards,
Tank
eo_support
Posted: Saturday, April 15, 2017 6:35:59 PM
Rank: Administration
Groups: Administration

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

You will not be able to call back into the JavaScript code inside your JavaScript extension function (this can cause dangerous re-entering issue thus is disabled on purpose). One way to get around this restriction is to use JSON to encode the whole JavaScript object into a string and then parse it back to object on C# side.

We can not tell you why some properties are empty in your JSON object. You can try to debug it and see if it properly encoded. Because JSON encodes the object into a single string, it is unlikely for our component to selectively miss some properties since all we do is to passing the string from JavaScript to .NET. If you still believe the problem is on our side, you can try to isolate the problem into a test project and send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

We will investigate further as soon as we have the test project.

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.