UriFragmentListener...

Hi,
I’m using navigator to navigate to different view. On left side of screen I have menu and right size is the compoment, that Navigator uses to render it’s views. Everything working fine only the menu (Accordion component) is not updated. So my idea was to add something like this:

Page.UriFragmentChangedListener pageListener = new Page.UriFragmentChangedListener() {
                @Override
                public void uriFragmentChanged(UriFragmentChangedEvent event) {
                    if (tabs.containsKey(event.getUriFragment())) {
                        int actualTabPosition = accordion.getTabPosition((Tab) accordion.getSelectedTab());
                        int requestedTabPosition = tabs.get(event.getUriFragment());
                        if (actualTabPosition != requestedTabPosition) {
                            //only when the requested tab differs
                            accordion.setSelectedTab(requestedTabPosition);
                        }
                    }
                }
            };
            UI.getCurrent().getPage().addUriFragmentChangedListener(pageListener);

The problem is the event is not fired when I enter some URL in a browser. The view loads correctly according to requested URL, but the listener is not invoked at all and thus I can not set the correct selected tab.
"
Accidentally I found out the it will not fire with this “hashgangbang” #! sign, but when I use only “#” in URL seems it is correctly fired. I also found out the “#” should not be used anymore according to migration guide, but why is this listener only reacting for “#” and not for in at least beta10, 11 used “#!”??? Is it bug or not???

Another question, will there be any other beta version?? We thought we will get at least rc1 by the end of the year, but now it seems we need to wait till January. Our project kick-off is in January and it will run for half a year, but I thing it is risky to use 7.0.0, if the project is late. Any link why is it actually delayed???

Thanks for your time

M.

Why there was no 7.0.0 for Chistmas…

https://vaadin.com/blog/-/blogs/sorry-no-7-0-0-for-christmas

The UriFragmentChangedListener returns the whole URI-Fragment starting from the hashsign (#). So URI-Fragments generated by the navigator start with an “!”. Therefore your Listener probably doesn’t find the correct tab.