Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@PushStateNavigation with @PreserveOnRefresh does not work correctly #11416

Closed
apgsga-stb opened this issue Jan 9, 2019 · 1 comment
Closed
Labels
bug workaround Workaround provided in ticket comments
Milestone

Comments

@apgsga-stb
Copy link

If your UI has both annotations, @PushStateNavigation and @PreserveOnRefresh, then the navigation does not work properly. Changing the URL in the browsers address bar does not switch the view. This is because navigation is not performed in that case. See classes UIInitHandler and UI.

As a workaround I have overridden doRefresh in my UI-Class:

  @Override
  public void doRefresh(final VaadinRequest request) {
    super.doRefresh(request);
    final RadNavigator navigator = getNavigator();
    if (navigator != null) {
      navigator.navigateTo(navigator.getState());
    }
  }
TatuLund added a commit that referenced this issue Jan 9, 2019
Navigation needs to be done also in doRefresh(..) in similar fashion as in doInit(..)

Fixes #11416
@TatuLund
Copy link
Contributor

TatuLund commented Jan 9, 2019

Thanks for reporting this, I issued pull request for a fix and to test if there are failing regression tests.

@TatuLund TatuLund added bug workaround Workaround provided in ticket comments labels Jan 9, 2019
ZheSun88 pushed a commit that referenced this issue Jan 11, 2019
Navigation needs to be done also in doRefresh(..) in similar fashion as in doInit(..)

Fixes #11416
ZheSun88 pushed a commit that referenced this issue Jan 17, 2019
Navigation needs to be done also in doRefresh(..) in similar fashion as in doInit(..)

Fixes #11416
ZheSun88 pushed a commit that referenced this issue Jan 22, 2019
Navigation needs to be done also in doRefresh(..) in similar fashion as in doInit(..)

Fixes #11416
@mehdi-vaadin mehdi-vaadin added this to the 8.7.0 milestone Feb 1, 2019
TatuLund added a commit that referenced this issue Jun 6, 2019
Fixes #11614

Old patch #11416 calls navigateTo allways when Navigator is present, which is wrong, since it is needed only when navigation state has truly changed.
ZheSun88 pushed a commit that referenced this issue Jun 7, 2019
…tor (#11615)

* Fix regression that broke PreserveOnRefresh functionality with Navigator

Fixes #11614

Old patch #11416 calls navigateTo allways when Navigator is present, which is wrong, since it is needed only when navigation state has truly changed.

* Add test to the fix
ZheSun88 pushed a commit that referenced this issue Jun 12, 2019
…tor (#11615)

* Fix regression that broke PreserveOnRefresh functionality with Navigator

Fixes #11614

Old patch #11416 calls navigateTo allways when Navigator is present, which is wrong, since it is needed only when navigation state has truly changed.

* Add test to the fix
ZheSun88 pushed a commit that referenced this issue Jun 12, 2019
…tor (#11615)

* Fix regression that broke PreserveOnRefresh functionality with Navigator

Fixes #11614

Old patch #11416 calls navigateTo allways when Navigator is present, which is wrong, since it is needed only when navigation state has truly changed.

* Add test to the fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug workaround Workaround provided in ticket comments
Projects
None yet
Development

No branches or pull requests

3 participants