|
|
|
|
|
|
Re: Branding body isn't removed upon app loading [message #1250514 is a reply to message #1250422] |
Wed, 19 February 2014 10:07 |
|
Hi Barys,
the following snippet should do the trick. If you call this method in
your entrypoint, the splash will be removed when the initial shell is
rendered.
private void removeSplash() {
JavaScriptExecutor executor
= RWT.getClient().getService( JavaScriptExecutor.class );
executor.execute( "(function(){"
+ "var splash = document.getElementById('splash');"
+ "splash.parentNode.removeChild(splash);"
+ "})();" );
}
Please make sure that you choose an id that doesn't collide with RAP's
widget ids (maybe use a prefix like my_splash to be on the safe side).
Regards,
Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Branding body isn't removed upon app loading [message #1251013 is a reply to message #1250514] |
Wed, 19 February 2014 20:51 |
Barys Dubauski Messages: 38 Registered: July 2009 |
Member |
|
|
Thank you, Ralph. Your snippet worked and splash portion of the html went away upon application start. It is not perfect: there is a slight timing issue with blank page at some times during application reload before new splash is displayed.
I suspect that this problem with splash image/div not going away may have a result of an earlier workaround I applied in our code. Here is short description:
- our application needs to support automatic restart (i.e. user clicks a button in UI, equinox framework shuts down with 'restart' exit code, then the framework starts again, browser refreshes through the timeout).
- unfortunately, the during restart I was seeing a lot of exceptions like java.lang.IllegalStateException: Could not delete: <path to .metadata\.plugins\org.eclipse.rap.ui\context\rwt-resources\generated\97740fa5.png> image file.
- I investigated the origin of the deletion requests and located: org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.deactivate() which was in turn calling ResourceDirectory.deleteDirectory and eventually attempting to delete an image file.
- Calling ApplicationContextImpl.skipResoureDeletion = true; did the trick to suppress these exceptions. However, now I suspect that this disabled resource clean up is the cause of strange behavior with splash image display.
I'm wondering that if resources cleanup went successfully (I don't know how to achieve that without using the "skipResoureDeletion = true"), the "manual" removal of splash div wouldn't be necessary...
Thank you for your help on this,
-Barys
[Updated on: Wed, 19 February 2014 20:53] Report message to a moderator
|
|
|
Re: Branding body isn't removed upon app loading [message #1251504 is a reply to message #1251013] |
Thu, 20 February 2014 09:35 |
|
Hi Barys,
This exception means that some of the resources generated by RAP could
not be cleaned up at shutdown. Would you mind opening a bug for this?
The `skipResoureDeletion` flag is used only in tests, it's not supposed
to be set by application code. If setting this field works around your
current problem, you should be aware that the directory
`context\rwt-resources` is never cleaned up by RAP.
At any rate, this exception is about the deletion of a file on the
server, it has nothing to do with removing the splash screen from the
DOM in the client. As Ivan already stated, there has never been a
mechanism in RAP that automatically removed splash screens from the HTML
body.
So the snippet that removes the splash is currently the way to go. We
might think about integrating some kind of splash screen support into
the framework. If you think this would be helpful, please open an
enhancement request.
Regards,
Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04534 seconds