Is there a way to access a parent window via Javascript in RAP?
This is my scenario:
I have two web applications, let's call them app A and app B.
App A opens a modal dialog in Javascript
var result = window.showModalDialog(url to app B, window.self, "")
then app B returns a value in this way
window.returnValue = some value;
So when the user closes the modal dialog, the caller reads back the value inside the variable result.
App B has been replaced by a RAP application, and I need to pass the value back to the caller app. So I tried to use the same Javascript code in RAP like this:
JavaScriptExecutor executor = client.getService(JavaScriptExecutor.class);
if(executor != null) {
executor.execute("window.returnValue = some value; ");
}
This doesn't work, the parent window gets undefined as a value for result.
I also tried to access the parent window with
var parent = window.dialogArguments;
but the result is undefined.
Is there a way to approach this problem in RAP?