|
HistoryTokens
History tokens and bookmarks
IntroductionGWT use history tokens to manage browser history. It allows to identify a client state, and bookmark a page. http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsHistory.html http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/History.html gwt-mvcgwt-mvc had reused JSP conventions for the token. Le token is composed like this: #ACTION?param1=value1¶m2=value2 Create an URLYou can use your browser or a bookmark to reach a known page. and you can define links with MvcHyperlink. verticalPanel.add(new MvcHyperlink("Url parameters (value=5)",PocAction.SHOW_URLPARAMS , new MvcHyperlinkEntry("modelA","5")));Use the tokenThe params are available with the method getUrlParam in each controller. content.clearAndAdd(pocViewNumeric);
Integer modelAParamValue = Integer.valueOf(getUrlParam("modelA"));
updateModel(modelA, modelAParamValue, event);Exemple |
► Sign in to add a comment