is there a way in smartgwt to go back in history?
E.g. I have an page with a button which does a Ajax page change of the current page to another. And on this new page there should be a button to return back to the previous page开发者_运维百科?
Can this be done with smartGWT? or do I have to make a new Ajax call to switch back to the previous page?
The functionality you want is provided by History class. Need to declare in web.xml and then use History.fireItem("SomeURL"), this will appear in app url as the string after # in URL is History ID ( something like http://google.com#SomeURL), you can use arbitrary IDs.
Use History.registerCallback() to register a function that opens requested History ID (eg. tab name/ID) on URL change (History's ValueChange function) and use History.addHistoryEntry() to update the page URL when other tab is selected.
If you implement this History class then you can use the browser's forward and back icon for the same purpose.
精彩评论