Redirect to ExternalResource


I have some problems with redirect between ExtRes.

First. How can redirect to MainWindow after some redirects between windows?
getApplication().getMainWindow().getWindow().open(new ExternalResource(getApplication().getMainWindow().getURL()), “_self”) - not work.
Where I have made a mistake?

Second. How can redirect to .pdf or jpg file in my project?


Could you make the question clearer? If you are trying to make the user download the file, then use “_blank”

You can redirect to images and pdf the following way:

getMainWindow().open(new ExternalResource(“”));

[/code] Note that the “_self” is implicit and not needed. Important thing is that you should call the open method on a window that is currently visible it to work.

To redirect to a resource in a file you can use the
instead of ExternalResource. For more information about resources take a look at

To redirect back to a window is little bit different thing. Mostly you can just change the window instance by using
. See this for more info: