Re: Use o:cache / p:cache for p:menu
Posted: 26 Apr 2021, 16:31
@rider, did you got an update from Primetek???
Code: Select all
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.6</version>
</dependency>
Code: Select all
<context-param>
<param-name>primefaces.CACHE_PROVIDER</param-name>
<param-value>org.primefaces.cache.EHCacheProvider</param-value>
</context-param>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true"
monitoring="autodetect" dynamicConfig="true">
<diskStore path="java.io.tmpdir" />
<!-- Sample cache named myCache
This cache contains a maximum in memory of 10000 elements, and will expire
an element if it is idle for more than 5 minutes and lives for more than
10 minutes. If there are more than 10000 elements it will overflow to the
disk cache -->
<cache name="myCache"
statistics="true"
maxEntriesLocalHeap="10000"
maxEntriesLocalDisk="1000"
eternal="false"
diskSpoolBufferSizeMB="20"
timeToIdleSeconds="300" timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
</ehcache>
Code: Select all
<p:cache region="myCache">
<pm:tabMenu id="tabMenu">
.
<!-- Some menu codes-->
.
</pm:tabMenu>
</p:cache>
Code: Select all
<p:cache region="myCache">
<h:form>
<pm:tabMenu id="tabMenu" stateful="true" >
<pm:tab id="dashboardTab" icon="fa fa fa-tachometer"
title="ALLGEMEIN">
<pm:menu>
<p:menuitem value="Dashboard" icon="fa fa-fw fa-tachometer"
onclick="PF('statusDialog').show()" outcome="/portal/dashboard" />
<p:menuitem value="Alle Dashboards" icon="fa fa-fw fa-list"
rendered="#{checkPermissionController.checkPermission('dashboard:showAll')}"
onclick="PF('statusDialog').show()"
outcome="/portal/dashboardList" />
</pm:menu>
</pm:tab>