Hi,
We are developing an application using the Paradise theme. Whenever we are lading in the pages, the previously visited left menu is getting highlighted rather than presently visited menu. It seems clearMenuState method of layout.js not working properly. Do you have any insight how to address this issue?
Koushik Mitra
Paradise theme left menu not getting highlighted properly
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 27
- Joined: 05 Oct 2016, 14:32
I found an alternative way to fix it.
1. Removed framework specified active-menuitem class using jquery
$(document.getElementById('menuId')).removeClass('active-menuitem');
2. Created alternative style class highlightVisitedMenu
.highlightVisitedMenu {
background-color: red !important;
color: Yellow !important;
}
3. <p:menuitem value="Menu Name" icon="[Relevant Icon]" id="menuId"
outcome="menuOutcome"
styleClass="#{view.viewId == 'page.xhtml' ? 'highlightVisitedMenu ' : ''}" />
1. Removed framework specified active-menuitem class using jquery
$(document.getElementById('menuId')).removeClass('active-menuitem');
2. Created alternative style class highlightVisitedMenu
.highlightVisitedMenu {
background-color: red !important;
color: Yellow !important;
}
3. <p:menuitem value="Menu Name" icon="[Relevant Icon]" id="menuId"
outcome="menuOutcome"
styleClass="#{view.viewId == 'page.xhtml' ? 'highlightVisitedMenu ' : ''}" />
Koushik Mitra
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Could you please attach your menu's code? Do you update the menu after calling clearMenuState?
Best Regards,
Best Regards,
Github Profile: https://github.com/mertsincan
-
- Posts: 27
- Joined: 05 Oct 2016, 14:32
I thought clearMenuState will be invoked by the framework only. Do I need to call the clearMenuState method explicitly and update the menu form? do you have any code snippet or example or reference to have a look?
The actual code I can not post. If I understand what you are asking so I can write a similar code stub and post.
Regards
The actual code I can not post. If I understand what you are asking so I can write a similar code stub and post.
Regards
Koushik Mitra
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Please try;
<pv:menu widgetVar="paradiseMenuWidget">
Best Regards,
Code: Select all
<script type="text/javascript">
//<![CDATA[
$(function() {
var widget = PF('paradiseMenuWidget');
if (widget) {
widget.clearMenuState();
var activeMenuItems = widget.jq.find('li.active-menuitem');
for (var i = 0; i < activeMenuItems.length; i++) {
var menuitem = activeMenuItems.eq(i);
menuitem.removeClass('active-menuitem');
var submenu = menuitem.children('ul');
if(submenu.length) {
submenu.hide();
}
}
}
})
//]]>
</script>
Best Regards,
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 12 guests