How to reload the web page in GWT? I want to reload the page after a user logged in the system and then it will show the personal status on top of the page. Any idea how?
Thanks a lot.
Window.Location.reload()
will reload the page, but I'm pretty sure reloading the page is not what really you want.
You probably just want to refresh certain parts of the page to update once the user logs in.
The reason is, reloading the page will re-download the JavaScript and images on the page, which is a lot of traffic just to refresh the UI.
For problems like these, you could use an event bus... seems very well suited to what you want to do. Your authentication widget could raise an authentication event on the bus, and all widgets on the page that ought to be reacting to this can just pick it up and change themselves.
There's a discussion about it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With