I'm using a view scoped managed bean and the annotation @PreDestroy to execute a method when navigating outside one page. I got some icons in the topbar and when I navigate through them to other pages, JSF detects the navigation (using faces-redirect=true) and executes the method. But when I navigate through the menu JSF doesn't detect the navigation thus not executing the annotated method.
This is the code for the menu.
Code: Select all
<pa:tabMenu>
<pa:tab icon="fa fa-anchor" title="Menu">
<h:form id="frmMenu">
<pa:menu widgetVar="miMenu" model="#{menu.miMenu}"/>
</h:form>
</pa:tab>
</pa:tabMenu>
Code: Select all
DefaultSubMenu submenu = new DefaultSubMenu("");
DefaultMenuItem item;
for(Modulo modulo : modulos){
item = new DefaultMenuItem();
item.setValue(modulo.getName());
item.setOutcome(modulo.getUrl());
item.setIcon(modulo.getIcon());
item.setAjax(false);
submenu.addElement(item);
}
Code: Select all
<div class="logo">
<h:form>
<h:commandLink action="index?faces-redirect=true"
title="Go to Index">
<h:graphicImage value="resources/images/logo.png" />
</h:commandLink>
</h:form>
</div>