I have the below code described for displaying the menu and highlighting the current active menu :
$(document).on("click", "#menu\\:panelMenu li a",function (e) {
e.preventDefault();
$('#menu\\:panelMenu li a').removeClass("active");
$(this).addClass('active');
});
.active {
color: #D09d23;
font-weight: bold;
background-color : #c7c3c3;
}
<h:form id="menu">
<p:menu style="width:100%" id="panelMenu">
<p:menuitem value="Customer"
outcome="/secure/customerdetail.xhtml?customerId=#{controller.customerid}" ajax="false" id="custMenu"/>
<p:menuitem value="User" outcome="/secure/userlist.xhtml?customerId=#{controller.customerid}" ajax="false" id="userMenu" />
</p:menu>
</h:form>
But when i included the JS code for adding the css class, the navigation the mentioned page fails to happen. I tried using both url and outcome. The highlight of the active menu is happening fine. BUt the navigation to the mentioned url fails to happen.
Kindly let me know what i am missing here.