Use o:cache / p:cache for p:menu
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.
Hi,
Sorry for delayed response! We released new update. Please check with new version and sample p:cache:
firstly add this dependency to the your pom.xml
after than add these lines to your web.xml file
create new file as src/main/webapp/WEB-INF/ehcache.xml with these sample codes:
You are ready for use p:cache. So add p:cache tag whatever you want! Especially to the tabMenu:
Best Regards,
Sorry for delayed response! We released new update. Please check with new version and sample p:cache:
firstly add this dependency to the your pom.xml
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>
Thanks for the update. I´ve updated to PF 10 and this template (version 3.0)
I´ve tried that, but it´s still not working for me:
As soon I´ve clicked than on a pm:tab / or menu, my url changed to: http://localhost:8080/portal/dashboard.jsf# (with a "#").
Seems like also other ajax menus are not working like the menu in the right corner from the template.
How can this be fixed?
I´ve tried that, but it´s still not working for me:
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>
Seems like also other ajax menus are not working like the menu in the right corner from the template.
How can this be fixed?
Primefaces 12.0, WildFly 21
Hi,
Sorry but I could not reproduce your issue. Please try without "<h:form>" component. As far as I know, there should not be nested forms and I think you have already defined a menuform to create a menu. As in the Template project. Because nesting forms is illegal in HTML, so also in JSF since all it does is just generating HTML. You need to put them next to each other. Also, a config in your web.xml file or project settings or server version or what server software you use may be causing this. If you try the above codes with tag folder in the new version, you can see that there is no issue. If you want, if you create a test project with this issue and send me an e-mail via "m.buunsal@gmail.com", I can examine it in detail.
I also noticed that you are using the ".jsf" page extension. The issue may also be caused by this. Submitting a test project will provide the fastest solution.
Best Regards,
Sorry but I could not reproduce your issue. Please try without "<h:form>" component. As far as I know, there should not be nested forms and I think you have already defined a menuform to create a menu. As in the Template project. Because nesting forms is illegal in HTML, so also in JSF since all it does is just generating HTML. You need to put them next to each other. Also, a config in your web.xml file or project settings or server version or what server software you use may be causing this. If you try the above codes with tag folder in the new version, you can see that there is no issue. If you want, if you create a test project with this issue and send me an e-mail via "m.buunsal@gmail.com", I can examine it in detail.
I also noticed that you are using the ".jsf" page extension. The issue may also be caused by this. Submitting a test project will provide the fastest solution.
Best Regards,
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests