GWT 2.1 Place/Activity technique glitch: URL changes before navigation is confirmed

亡梦爱人 提交于 2019-12-04 16:54:05

There's no workaround. Your app somehow detects that the URL has changed, which triggers the place change (thus before navigation is confirmed).

And there's no way to know why the URL changed; was it a "back"? a "forth"? a "back" using the history menu to go several steps back at a time? a bookmark? manual editing of the URL? So there's no way you could do a History.next() to "cancel" the URL change in all cases (also note that it would trigger another place change). And trying to modify the URL with anything else than History.back/next/go would erase the forward history, which you probably don't want either.

FYI, I implemented that behavior 2 years ago in my own "place manager", and talked about it with Ray Ryan when he added the PlaceHistoryHandler to GWT 2.1, and we agreed that there was no better behavior than letting the URL no longer being in sync with the place. FYI, when I studied the thing 2 years ago, and then earlier this year, GMail had the same behavior (create a draft message and navigate while the draft has unsaved changes).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!