Usage of UriFragmentUtility


I just used UriFragmentUtility in some examples. Now my question is, how to use it the best way for changing the site in a vaadin application. I think there are two options.

First, I can call the method ‘setFragmet()’. In the next step, the listener is executed where the next site is loaded.

The second option would be to call ‘setFragmet(“fragmet”, false)’. In this case, the listener isn’t executed and I have to open the new site manually. In this case, I can pass Java objects directly to the new Site / Layout. But the disadvantage is that I have to implement to ways for opening a site. The direct way when I pass an Java Object and the indirect way where I read an id in the fragmet.

Which option do you prefere in your applicatoins? Or is there a third option?