-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.2.1
-
Security Level: Jimmy
Steps to Reproduce
run the example multiple-historyPopState.zul
click the button a few times (pushes browser history states)
navigate back
observe the server logs
Current Result
the method handleHistoryPopState is called multiple times for the same history pop state event
Expected Result
handleHistoryPopState called once
Debug Info
the number how often the method is called corresponds to the number of root components on the page
Workaround
listen to onHistoryPopState with a @Command binding
<div viewModel="@id('vm') @init('zk.support.BrowserHistoryVM')" onHistoryPopState="@command('handleHistoryPopState')"> ...
@Command public void handleHistoryPopState(@ContextParam(ContextType.TRIGGER_EVENT) final HistoryPopStateEvent event) { final Object state = event.getState(); System.out.println(state); }
- relates to
-
ZK-3711 Support HTML5 history API
- Closed