RAP JavaScriptExecutor and returning values [message #1117566] |
Thu, 26 September 2013 11:23  |
Eclipse User |
|
|
|
I use JavaScriptExecutor with RAP, which is nice for simple JS execution e.g.
JavaScriptExecutor executor = RWT.getClient().getService( JavaScriptExecutor.class );
if( executor != null ) {
executor.execute( javaScriptCode );
}
However, is there a way to do something similar to execute a javascript function that returns a value, and capture that value... a bit like evaluate for browser controls, but acts on the whole page?
My initial requirement might be a javascript function that gets the value of a cookie on the client.
Thanks, John
|
|
|
|
Re: RAP JavaScriptExecutor and returning values [message #1118354 is a reply to message #1117648] |
Fri, 27 September 2013 06:18  |
Eclipse User |
|
|
|
Hi Ivan,
Ok, yes, for cookies I can use RWT.getRequest().getCookies(), and this works ok, including RWT.getResponse.addCookie(...).
However, it was more of a general question about JavaScript... if I loaded some JavaScript using JavaScriptLoader, then wanted to call a function later to evaluate to a value, then there is no way to do this.
I'm not sure it matters too much, but thought it could potentially have some uses.
Thanks, John
|
|
|
Powered by
FUDForum. Page generated in 0.06630 seconds