Menu highlighting error.

Post Reply
Proyecto SIAM
Posts: 5
Joined: 24 Oct 2017, 18:37

04 Jan 2018, 17:59

I got a dynamic menu, the model is created the first time the user enter to the index page based on user permissions. Sometimes when I click on some item in the menu, the highlighted element is incorrect.

The code for the menu is as follows.

Code: Select all

    <div class="layout-sidebar layout-sidebar-dark">

            <pa:tab icon="fa fa-anchor" title="Pantallas">
                <h:form id="menu">
                    <pa:menu widgetVar="me" model="#{menu.model}"/>
Part of the result HTML code is:

Code: Select all

<ul role="menu" style="display: block;">
  <li id="menu:j_idt73_0_0" role="menuitem">
    <a class="ripplelink" href="/SISTEMA/nuevoUsuario.xhtml" >..</a>
  <li id="menu:j_idt73_0_1" role="menuitem">
    <a class="ripplelink" href="/SISTEMA/usuariosRegistrados.xhtml" >
      <i class="fa fa-users">..</i>
      <span>Control de usuarios</span>
How can I solve this issues?
I'm using JSF 2.2, Wildfly Server 10.1.0, Primefaces 6.0 and Barcelona 1.0.2

Proyecto SIAM
Posts: 5
Joined: 24 Oct 2017, 18:37

15 Jan 2018, 21:47

I found the solution.
Some pages had the code:

Code: Select all

        <f:viewAction action="#{someBean.someMethod()}"/>
The solution is to change the viewAction and replace it with event, like this:

Code: Select all

        <f:event type="preRenderView" listener="#{someBean.someMethod()}"/>
After doing this change, the menu works correctly.

Posts: 46
Joined: 10 Jan 2018, 16:04

18 Jan 2018, 18:01

You need to add an id to pa tag. For example:

Code: Select all

<pa:menu id="yourID" widgetVar="me" model="#{menu.model}"/>
Best Regards

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest