how to highlight <p:menuitem>

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
afro22
Posts: 2
Joined: 11 Oct 2015, 17:48

03 Jun 2018, 20:27

i create menu

Code: Select all

<pc:menu widgetVar="me" >
    <p:menuitem id="om_users" value="Users" icon="fa fa-users" outcome="/app/users"/>
    <p:menuitem id="om_files" value="Videos" icon="fa fa-copy" outcome="/app/videos"/>
</pc:menu>
but after start i have active item Videos (last item), i want to active first item.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

11 Jun 2018, 08:13

You can add 'active-menuitem' class to a menuitem. OR we use cookie to highlight a menuitem after refreshing page, logout/login etc. Maybe, you can use it. Exp;

Code: Select all

var menuWidget = PF('me');
menuWidget.clearMenuState();
menuWidget.addMenuitem('MENUITEM_CLINTID');
menuWidget.restoreMenuState();

Post Reply

Return to “California - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests