How do I determine whether I am going “forward” or “backward” through my History in GWT?

后端 未结 2 446
予麋鹿
予麋鹿 2020-12-18 08:44

I am looking at History and History JavaDocs in GWT and I notice that there is no way to tell whether the forward or backward button was pressed (either pragmatically or by

2条回答
  •  执念已碎
    2020-12-18 09:08

    Sorry, you can't. And even if you could, there are browsers, like Firefox, that let the user "jump" back more than one page. So if you try to relying on relative "coordinates" instead of absolute, the navigation could break your app.

    You can always append some kind of counter on your history token. It would not be hard, if you have only one history listener.

提交回复
热议问题