Monday, June 6, 2016

Unable to make loading screen appear

Hello

I have created in my HTML a div holding an image like this:

<body>
...
<div id="loading">
Loading...<br />
<img src="administrarebloc/images/icons/splash.gif"/>
</div>
...
</body>

It has display: block by default, so until my aplication is loaded it stays there. In my onModuleLoad(), after loading is finished, I hide it like this

DOM.getElementById("loading").getStyle().setDisplay(Display.NONE);

But later, when I'm navigating to another place (MVP), I have an option, which sends emails to everybody in the DB, so before my RPC call I inserted this

DOM.getElementById("loading").getStyle().setDisplay(Display.BLOCK);

and then again I inserted the .setDisplay(Display.NONE) in the onSuccess() and onFailure() method.

My problem is, it that the loading screen does not appear when the rpc starts. And it takes some time to send emails, so it's not like it appears for a millisecond and then dissaprears, it does not appear at all.

How can I make it visible there and hide it afterwards ? 

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment