I implemented my own for my web application, in my case I did not use the p:breadCrumb , because it is implemented using buttons.
Basically, I have an @SessionScoped bean that contains a stack (navigation stack) that stores the entire URL that you have in the palette, and the parameters for each of them. The view part (xhtml) consists of p:button elements that have the outcome stored stack URLs.
When you go to the URL, the corresponding bean f:event type="preRenderView" is called f:event type="preRenderView" (as you do), and the bean takes parameters from the URL, after which it sets itself onto the stack (and not the bean, call it @ViewScoped and will be destroyed, just url and params).
If you click the back button in breadcrum, you will send an additional parameter that indicates the index of the button. Based on this index, the target bean knows that you are trying to restore such a view, therefore, it asks for the navigation stack for these viewing parameters, and the navigation stack deletes the overlays that follow it.
It took me a while, but it is fully functional. Good luck.
Edit
Use caution when using the session area to maintain the current state of navigation. This will affect all open tabs, so this is probably not what you want, unless you expect your end user to be able to use your application on only one tab. In any case, in the general rules of usability, you should use categories, not navigation paths for your breadcrumbs ( HTTP has no status , but the history itself is stored in the browser). Thus, the dynamic wand no longer makes sense, at least if you use different URLs for your views.
source share