In my case, none of the previously open solutions worked for me, because I use p: layout. So I had p: ββpanelMenu in the west of p: layoutUnit, and my main form was in the center of p: layoutUnit. Then, when I tried to go to another page, the menu returned to its original state, and I do not know why.
My solution so far is to simulate a click with jQuery from an action method in a bean base as follows:
RequestContext.getCurrentInstance().execute("$('#menuItemId').click()");
Now I can save the state p: panelMenu and go to the desired page.
In the first question, you can also click the link using jQuery. I know that each script is different, but you can use the jQuery call from the bean backup anyway.
source share