tags:

views:

111

answers:

1

how to load the other HTML page when i click a button? i'm using GWT 2.0.3.

        p.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                 // TODO Auto-generated method stub

                // is there a syntax to load other HTML?
            }
       });

thanks before, Rafael.

+5  A: 

If you use GWT's history mechanism, then you want to look at History.newItem("newPage");

If you want to jump to a totally new URL (and navigate outside your application) then you can use Window.Location.replace("newURL");.

Finally, if you just want to change the page within your application but are not using history, then you probably want to do something like:

RootPanel.get().clear()
RootPanel.get().add( widgetForNewPage );
Philippe Beaudoin
@rafael11 Consider marking the answer as accepted if it answers your question.
Philippe Beaudoin
thank's a lot man..
Np. Just mark the answer with a check.
Philippe Beaudoin