I have the current problem, that a list (p:repeat) is calling everytime to the bean (request to the database) as soon the <pm:tabMenu is loaded which costs performance and increase the page load...
Is there a possibility to load this list only if the user clicks this menu entry?
So from the example page:
https://www.primefaces.org/morpheus/
If the user clicks the menu entry: "features" than the <p:repeat> should be loaded:
Here is a short example:
-> value="#{lastUsageLast25EntriesNotLazyController.lastUsageList}" from <p:repeat should be load / request to database only if the user is click on:
<pm:tab id="tab1" icon="fa fa fa-tachometer" title="ALLGEMEIN">
Code: Select all
<pm:tabMenu id="tabMenu" stateful="false">
<pm:tab id="tab1" icon="fa fa fa-tachometer" title="ALLGEMEIN">
<h:form id="menu-form">
<pm:menu widgetVar="me">
<p:menuitem value="Dashboard" icon="fa fa-tachometer"
outcome="/portal/dashboard" />
</pm:menu>
<div class="layout-submenu-title" />
<h:outputText value="ZULETZT VERWENDET" styleClass="FontBold" />
<p:repeat
value="#{lastUsageLast25EntriesNotLazyController.lastUsageList}"
var="lastUsage">
<h:outputFormat escape="false"
style="margin-left: 5px; white-space: nowrap;"
value="#{lastUsageLast25EntriesNotLazyController.generateString(lastUsage)}" />
<p></p>
</p:repeat>
</h:form>
</pm:tab>
BTW: i tried also to use p:cache around the whole <pm:tabMenu id="tabMenu" but than if I click on a menu entry nothting is happening, but I don´t think so that´s also the solution because the <p:repeat will be than also cached?
How can I do this?