Ajax with caching does not working

UI Components for JSF
Post Reply
song.xiao
Posts: 2
Joined: 22 Jan 2018, 16:35

13 Jun 2018, 21:59

I have the following datatable and it works fine.

Code: Select all

<p:dataTable id="example" var="item"
value="#{controller.itemList}" selectionMode="single"
selection="#{controller.selectedItem}"
rowKey="#{item.id}" scrollable="true" scrollWidth="100%"
scrollHeight="100%" paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" rows="10" paginatorPosition="bottom">
	<p:column headerText="Title" sortBy="#{item.title}">
		<h:outputText value="#{item.title}" />
	</p:column>
	<p:column headerText="name" sortBy="#{item.firstname} #{item.lastname}">
		<h:outputText value="#{item.firstname} #{item.lastname}" />
	</p:column>
	<f:facet name="paginatorBottomLeft">
		<h:outputLabel value="#{controller.itemList.size()} items found" />
	</f:facet>
	<p:ajax event="rowSelect" update=":mainform:editDialog :mainform:editButton :mainform:deleteButton" />
</p:dataTable>
After I add the cache to the table like following, the ajax call does not work any more.

Code: Select all

<p:cache region="menuCache" key="dttableContacts">
	<p:dataTable id="example"
	...
	</p:dataTable>
</p:cache>
I am using
Primefaces 6.2
EHCache 2.10.5
Jboss EAP 7.0
Java 1.8
Last edited by song.xiao on 14 Jun 2018, 13:57, edited 2 times in total.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

14 Jun 2018, 09:14

Please edit your question and use [ code ] ... [/ code ] tags (without the spaces around your code and use good indentation.

song.xiao
Posts: 2
Joined: 22 Jan 2018, 16:35

14 Jun 2018, 13:55

kukeltje wrote:
14 Jun 2018, 09:14
Please edit your question and use [ code ] ... [/ code ] tags (without the spaces around your code and use good indentation.
Thanks a lot for your tip. This is mine first post.

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

15 Jun 2018, 18:29

What are you trying to achieve with caching this way? Caching is meant for fairly static things, not dynamic datatables etc.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests