Thursday, January 31, 2013

Navigating to static HTML page on button click

Hi, 
I am new to GWT.   In my GWT application, I want send a direct request for static html up on a button click and the HTML page should be displayed. I tried below code. I can see that URL is correct but nothing is happening. I expected browser to display static html page but it remains on same page.  How can I do this ?

Code:
 TextButton signoutButton = new TextButton(messages.signoutButton());
        signoutButton.setDecoration(Decoration.PRIMARY);
        signoutButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String url = GWT.getHostPageBaseURL() + "logout.html";
RequestBuilder builder = new RequestBuilder( RequestBuilder.GET, url);
try {
Window.alert("URL" + url);
builder.send();
} catch (RequestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
};
});

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment