Should be simpler, but GWT requires you to do an onclick event for the buttons. Then you can use the Javascript Window location to go to the new URL.

	Toolbar toolbar = new Toolbar();
        ToolbarButton button = new ToolbarButton("Click to New URL", new ButtonListenerAdapter()
        {
            public void onClick(Button button, EventObject e)
            {
            	Window.Location.replace("http://www.google.com");
            }
        });
        toolbar.addButton(button);

Now when the button is clicked, it will act like a normal <a href link.

  • TwitThis
  • Yahoo! Buzz
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • MySpace
  • Google
  • Blogosphere News
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Technorati

Previous Post: Installing haproxy load balancing for http and https
Next Post: Recruiting

2 Responses to “Google Web Toolkit (GWT) Creating a hyperlink for a button”

  1. Funcinema on September 5th, 2009 1:38 pm

    Nice Plugin !!

  2. chupsy on November 17th, 2009 6:04 am

    thank you!!!! you saved me!!! :)

Leave a Reply