return java object to javascript

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

return java object to javascript

Postby nnachi » Mon Dec 26, 2016 4:06 pm

Hi

I saw the 2 examples of "binding_test" that explain the communication between JS and java. But in both cases a string a returned

Is it possible to return a java object ( a list for example) to javascript using CefMessageRouterHandler ? How can we do this ?

Thanks
Nazim
nnachi
Techie
 
Posts: 13
Joined: Fri Dec 23, 2016 6:39 pm

Re: return java object to javascript

Postby nnachi » Fri Dec 30, 2016 11:37 am

Hi,
I can bind a string to the request to java but is possible to bind a list of values ?
nnachi
Techie
 
Posts: 13
Joined: Fri Dec 23, 2016 6:39 pm

Re: return java object to javascript

Postby nnachi » Tue Jan 03, 2017 6:47 am

Hi

I found a way to do it using JSON, is there any other options ?

Thx
nnachi
Techie
 
Posts: 13
Joined: Fri Dec 23, 2016 6:39 pm

Re: return java object to javascript

Postby amaitland » Tue Jan 03, 2017 4:54 pm

Write your own message router
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: return java object to javascript

Postby nnachi » Tue Jan 03, 2017 7:03 pm

amaitland wrote:Write your own message router


Thank you for your answer but can you be more specific please ? I'm not really an expert with web developpment :roll:
nnachi
Techie
 
Posts: 13
Joined: Fri Dec 23, 2016 6:39 pm

Re: return java object to javascript

Postby amaitland » Tue Jan 03, 2017 9:54 pm

The cef message router is just the default implementation.

You can write your own with support for complex objects.

I'd just stick with JSON if it meets your requirements.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: return java object to javascript

Postby nnachi » Thu Jan 05, 2017 3:57 pm

Thank you for your answer
I will try this
nnachi
Techie
 
Posts: 13
Joined: Fri Dec 23, 2016 6:39 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 70 guests