yasser101991
yasser101991

Reputation: 93

How to redirect to another page in GWT application

Upvotes: 1

Views: 1260

Answers (1)

moh
moh

Reputation: 1526

GWT is Single Page Web Application,to Navigating one Screen to other screen just clear layout Container and add the newly created Container to RootPanel.See example code,

HorizontalPanel hp=new HorizontalPanel();
Button btn=new Button("Login");
hp.add(new TextBox());
hp.add(new PasswordTextBox());
hp.add(btn);
RootPanel.get().add(hp);

btn.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
RootPanel.get().clear();
RootPanel.get().add(new screen());
}
});

Upvotes: 1

Related Questions