Poseidon Set active Menu Item

Post Reply
Posts: 1
Joined: 07 Dec 2016, 08:33

17 May 2017, 10:26

is there a way to set the current active Menu Item in Code.
I do navigation via navigation-rules and would like to adjust the selected Menu Item based on the current page.

I tried this approach: http://blog.awolski.com/keeping-a-prime ... em-active/
but since the Menu-Component in Poseidon is a special component included in the theme, this approach did not work out for me.

I would be thankful for any suggestions on how i can set the active menu item of the PoseidonMenu-Component via code.

Kind regards,

User avatar
Posts: 3637
Joined: 29 Jun 2013, 12:38

17 May 2017, 14:57

We use jquery cookie for stateful feature on Poseidon menu. I think you can use it. You need to add id of active menu item into cookie. Exp;

Code: Select all

<script type="text/javascript">
    function testFunc() {
        var $this = PF('me');

        if($this) {
            /* clear state */
            $this.expandedMenuitems = [];



    <h:form id="menuform">
                    <pp:menu widgetVar="me">
                        <p:menuitem id="om_doc" value="Documentation" icon="fa fa-fw fa-book" outcome="/docs"/>

Code: Select all

<p:commandButton value="Docs" action="docs.xhtml" oncomplete="testFunc();"/>

Post Reply

Return to “Poseidon - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest