2

I want to navigate to another page in my application. I don't want the page to reload(i.e.. application should be a single URL application).

I know only one way to accomplish this by changing the proper div attached in the RootPanel by whatever data I want to display. But I fell that might get cumbersome if there are many navigations(I haven't tried it though :P).

Is there any other way to accomplish this or make the above said approach better?

Thanks in advance.

LPD
  • 2,833
  • 2
  • 29
  • 48
  • Possible duplicate of [Multiple pages tutorial in Google Web Toolkit (GWT)](http://stackoverflow.com/questions/1061705/multiple-pages-tutorial-in-google-web-toolkit-gwt) – Amos M. Carpenter Jan 25 '16 at 01:59

2 Answers2

4

I guess you need GWT Development with Activities and Places

Well ,its time to have a look on MVP

With that you can do

  History.newItem(tokenOfYourPresenterScreen);
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
  • So does that mean its compulsory to use MVP pattern in GWT to develop the application? – LPD Apr 24 '13 at 08:38
  • Not necessarily.As far as I know the way of functionality you are asking can achieve easily by MVP pattern. I am not sure If there is any easiest way to achieve this. – Suresh Atta Apr 24 '13 at 09:19
  • 1
    @LPD Activities and Places are about splitting the application in "sensitive areas" that properly react when a place (a token in your URL) changes, either in a programmatic (placeController.goTo() or History.newItem()) or manual way. So this is what you are looking for. MVP can be achieved, but definitely not required. Checkout [these](http://blog.ltgt.net/) articles. – Andrea Boscolo Apr 24 '13 at 09:50
  • Thanks for all your comments. Can I know if there is any demo app which demonstrates only activities and places (not MVP) so that I can get a head start? – LPD Apr 25 '13 at 05:27
0

A nice single EntryPoint demo app is here : (BrowserHistoryExample.java) http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html

I added the below to the example to demonstrate links.

vertPanel.add(new Label("Access history via Hyperlinks"));
vertPanel.add(new Hyperlink("External Page 0","page0"));
vertPanel.add(new Hyperlink("External Page 1","page1"));
vertPanel.add(new Hyperlink("External Page 2","page2"));
rjdkolb
  • 10,377
  • 11
  • 69
  • 89