Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload web page in GWT

Tags:

gwt

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.

like image 838
Amelia Avatar asked Nov 28 '22 06:11

Amelia


2 Answers

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.

like image 102
Jason Hall Avatar answered Dec 06 '22 05:12

Jason Hall


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.

like image 39
Sudhir Jonathan Avatar answered Dec 06 '22 05:12

Sudhir Jonathan