Q:

how to open a new browser page in GWT

I want to open new Page in browser  which will be some component .
like I am in  a page "MainPage "its a composite
Now on a click of a button I need to open a new page "DiagramPage" (its a composite)
I dont want to use a full MVP  (as these are the only 2 pages in my app).
Secondly when I am in DiagramPage (with the click on a button in MainPage).
from Diagrampage when I click on Browsers back button , It should take me back to MainPage and with all the things saved, Like whatever checkbox I did check on Mainpage previously and all.
Any suggestion.
Thanks  

A:

The GWT History should be all you need in this case. Read this for further information.
It all works with history tokens added to the URL, e.g. http://test.com/#firstPage
To enable the history, include this in your HTML template:
<iframe src="javascript:''"
    id="__gwt_historyFrame"
    style="position:absolute;width:0;height:0;border:0"></iframe>

You'll need to listen for history change events like this:
History.addValueChangeHandler(new ValueChangeHandler<String>() {
    public void onValueChange(ValueChangeEvent<String> event) {
        String historyToken = event.getValue();
        /* Set your new page content here based on the token */
    }
});

Then store the user selections on the new page in some sort of data structure. When the user clicks the back button, you'll get back to the previous "page" where you can just get the information from that data structure.

