Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » BrowserFunctions and evaluate from different Browser(s)(Evaluate method can't complete because busy)
BrowserFunctions and evaluate from different Browser(s) [message #1697223] Tue, 02 June 2015 13:56 Go to next message
Andrea Antonello is currently offline Andrea AntonelloFriend
Messages: 6
Registered: June 2015
Junior Member
Hello,
I have a problem with browserfunctions and evaluates from different Browser instances and was wondering which is the proper way to handle this usecase.

I have 2 Browser instances, one use to show a map (through leaflet) and one to show a chart (through d3).
When I click inside the map, a BrowserFunction of the mapBrowser is called to get some data from the RAP side to display them both the mapBrowser and in the chartBrowser.

The mapBrowser gets the data as return of the function, while for the chart panel I am using the evaluate method on its browser, before the return of the BrowserFunction.

This doesn't seem to work, I assume (the evaluate method states this in the javadoc) because scripts are executed while previous ones didn't finish.

Can anyone please give me a hint about the proper way to do this?
Thanks a lot.

Andrea
Re: BrowserFunctions and evaluate from different Browser(s) [message #1699556 is a reply to message #1697223] Thu, 25 June 2015 06:20 Go to previous message
Andrea Antonello is currently offline Andrea AntonelloFriend
Messages: 6
Registered: June 2015
Junior Member
Before changing to have half of my gui to be a single frame made of html instead of SWT widgets, I want to ask a further question.

I assume there is a reason for not being able to listen to the completing of scripts in a browser, but being no web developer I ignore it.

So I wanted to ask how terrible it is to "listen" manually in a dirty way to when a browser's script is done, which seems to be checked on the internal variable executeScript to be null.

So a dirty trick would be access it through reflection and check for when it is done. Something like:

        
Field f = browser.getClass().getDeclaredField("executeScript"); 
f.setAccessible(true);
Object exeScript = null; // IllegalAccessException
while( exeScript != null ) {
     exeScript = f.get(browser);
}


I tried and it works, but am not sure under which conditions it might explode.

Andrea
Previous Topic:Font Heights as Double/Float rather than Integer
Next Topic:how to custom error page instead of error 500
Goto Forum:
  


Current Time: Fri Apr 26 18:34:41 GMT 2024

Powered by FUDForum. Page generated in 0.03195 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top