Skip to main content

Home/ GWT - Samples/ Group items tagged anchor

Rss Feed Group items tagged

Esfand S

Anchors in GWT | GWT Tutorials - 0 views

  • The primary reason why I am writing a specific tutorial on the Anchor widget is because without it you will not be able to easily use GWT’s history framework
  • let’s talk about a hash, and how to use them. Since GWT is an easy way to use AJAX we are going to stay within that realm when talking about the hash. A hash is simply anything with the pound symbol in front of it. For example “#gwt” is a hash that points somewhere in your web application. We are going to learn more about the hash in the tutorial on GWT history.
  • Anchor anchor = new Anchor("GWT Tutorials", "http://www.gwttutorials.com?action=hello", "_blank");   String paramAction = Window.Location.getParameter("action");   //Do something with paramAction.
  • ...1 more annotation...
  • So basically the way this works is that you can create a new Anchor widget and append a parameter to it. In your onModuleLoad function you can get the parameter from the window’s location, and then use this parameter to load a different state of your application. To create a parameter just append a “?” then the name of the parameter and finally the value of the parameter. Also you can include multiple paramters by using the “&” symbol, so for example you could do this: “?action=hello&noaction=bye”.
1 - 1 of 1
Showing 20 items per page