Search code examples
gwtgwtp

How to redirect and then reload the page in GWTP?


Ok, I am using GWTP to build my app. I have a signUp page (mydomain.com#signUp) & a profile page (mydomain.com#profile).

I want that after user signed up successfully, the app will redirect to profile page & then reload() the profile page.

So here is what I did:

if(signedUpSuccessfully){
  PlaceRequest request=new PlaceRequest(NameTokens.profile);
  placeManager.revealPlace(request);
  Window.Location.reload();
}

However, after finished running, the app did reload but it still in the signUp page not in profile page.

So, How to let the app redirect to profile page then reload the profile page?

I don't want to use Window.open cos it could open new browser, which is very noisy.


Solution

  • after reload, the page will be refreshed, so it is actually just reload your whole APP. One way I can think of is redirect request to mydomain.com#profile, by calling window.location = mydomain.com#profile. GWTP should be capable of handling this.