Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Branding body isn't removed upon app loading(Body.html content is left at the top of the page after start)
Branding body isn't removed upon app loading [message #1245497] Thu, 13 February 2014 22:31 Go to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
This used to work fine in RAP 2.0 without any extra workarounds. I.e. the splash screen body (set via branding extensions) was automatically removed once the application finished loading.

In other words the body.html set in the
org.eclipse.rap.ui.branding extension point remains there for the
lifetime of the application.

I'm seeing this behavior myself as we are attempting to migrate RAP 2.0 -> 2.2

Is this a bug in 2.2?


Re: Branding body isn't removed upon app loading [message #1245498 is a reply to message #1245497] Thu, 13 February 2014 22:34 Go to previous messageGo to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
If using body.html from branding extension isn't the right way to go about implementing a splash screen for our RAP application, can someone recommend a better approach?

Thank you.
Re: Branding body isn't removed upon app loading [message #1248422 is a reply to message #1245497] Mon, 17 February 2014 08:37 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Barys,
just checked our Examples Demo (it has a loading splash in body) and the
splash is not removed from both RAP 2.0 and 2.2. There are no changes in
this direction between RAP 2.0 and 2.2. The splash stays below your
application shell. I think that this is the correct way to implement a
splash. Why do you think that the splash div is removed in 2.0 after the
application is loaded?
Best,
Ivan

--
Ivan Furnadjiev

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 #1249482 is a reply to message #1248422] Tue, 18 February 2014 09:41 Go to previous messageGo to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
Hi Ivan,

Sorry if I wasn't clear: what I meant is that in 2.0 splash div was automatically hidden upon application loading. And in 2.2 it still stays visible on the top of the page and the application content is displayed below it. I will check the page source under 2.0 to see what is different there compared to 2.2.

I did look at the demo examples and splash is behaving properly there.

Can you confirm that using branding extension and setting body html is the correct approach to implement splash?

Thank you,
-Barys
Re: Branding body isn't removed upon app loading [message #1249513 is a reply to message #1249482] Tue, 18 February 2014 10:15 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Barys,
yes... this is the correct way to go. The 'splash' div should stay below
your application once the application is loaded. Do you have any z-index
attribute set on your splash div?
Best,
Ivan

--
Ivan Furnadjiev

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 #1250422 is a reply to message #1249513] Wed, 19 February 2014 08:20 Go to previous messageGo to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
Hi Ivan,

There is no z-index attribute as far as I understand:

<div id="splash">
<img src="./splash.bmp">
<img src="./loading.gif" width="32" height="32" style="margin: 10px 15px 0"/>
</div>

-Barys
Re: Branding body isn't removed upon app loading [message #1250514 is a reply to message #1250422] Wed, 19 February 2014 10:07 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
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 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

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/
Re: Branding body isn't removed upon app loading [message #1252313 is a reply to message #1251504] Fri, 21 February 2014 05:01 Go to previous messageGo to next message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
Thank you for the reply, Ralph.

I opened Bug 428702 about resources not being cleaned by RAP.

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

:
Strangely, I performed few more experiments and found out that if the skipResoureDeletion=true and removeSplash() function are not used at all. Then splash screen is behaving like it used to (in RAP 2.0). The only adverse effect (not visible to users) is a bunch of exceptions I've already mentioned earlier. There must some indirect dependency between resource deletion code and the visibility of the splash image in the browser. It must be some mysterious connection.
Re: Branding body isn't removed upon app loading [message #1252314 is a reply to message #1252313] Fri, 21 February 2014 05:03 Go to previous message
Barys Dubauski is currently offline Barys Dubauski
Messages: 33
Registered: July 2009
Member
To summarize: if the Bug 428702 is fixed, we are in a good place.
Previous Topic:DirectoryDialog RAP
Next Topic:Sash with inner Buttons
Goto Forum:
  


Current Time: Thu Oct 23 12:39:15 GMT 2014

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

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