Pregunta

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.

¿Fue útil?

Solución

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.

Otros consejos

You would better making a PlaceRequest with the 'profile' name token and handling the "refresh" logic in the onReveal lifecycle method of ProfilePresenter.

Probably you'll need to hold a singleton over you app with the user info (which you'll fill after successfully authenticating). You can inject this singleton into the ProfilePresenter and handle the presentation of the view in the onReveal method. See the security package of carstore sample for a concrete example.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top