Question

Interestingly one of the developer of application is on leave and there is no way I can reach him.

We have a GWT application and we are trying to load a page temporarily with passing a token to a place. But since he has forgotten to document the URL to reach that place, we are not able to load the place.

So I am not getting how to find out the token. But I know the place.

Can someone guide me?

Was it helpful?

Solution

GWTP uses @NameToken( "MyPlaceName" ), so that this page can use the browser history. This will let you navigate to this presenter by entering the name token in the URL, or via an Hyperlink widget. This will also let you use the back and forward button of your browser to navigate in your application.

Each Presenter would have unique NameTokens as following.

...

@NameToken("main")
  public interface MyProxy extends ProxyPlace<MainPagePresenter> {}

...

You can reveal to the presenter as following.

PlaceRequest myRequest = new PlaceRequest("desiredNameToken");
// If needed, add URL parameters in this way:
myRequest = myRequest.with( "key1", "param1" ).with( "key2", "param2" );
placeManager.revealPlace( myRequest ); 

Hope it would help you !!!

OTHER TIPS

  PlaceRequest placeRequest = new PlaceRequest( "homepage");
  placeManager.revealPlace(placeRequest);

Where URL is the nametoken of the presenter .If you give the Nametoken as homepage the Presenter mapped to "homepage" will open . If you know which presenter you are going to open ,you can find the NameToken in that presenter It should be like

@NameToken("homepage");  
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top