Navigate between GWT modules

前端 未结 1 1470
无人共我
无人共我 2021-01-19 13:21

I\'ve divided my GWT app into multiple modules, what\'s the best way to navigate between them?

Currently I\'m using Window.Location.assign(\"foo.html#bar\")

相关标签:
1条回答
  • 2021-01-19 14:06

    History.newItem only works for history within the current module. To change to another page I think the best way is to use Window.Location.assign.

    I don't fully remember the issue (and perhaps it has been fixed now), but in our application we stopped using relative URLs as they would sometimes break (we have a comment referencing http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/f79e7d5e002b48f6).

    To this end we had a method that did the following:

    public void goToRelativePage(final String relativeURL) {
      Window.Location.assign(GWT.getHostPageBaseURL() + relativeURL);
    }
    
    0 讨论(0)
提交回复
热议问题