I am using <p:datatable> in UI to display the records using jsf. I am trying to add rows to the data table on click of Add button. On click of Add button, I am updating the list in the backing bean which in turn updates the datatable in UI with an extra row added. Now the issue is, the more I add rows to the data table, the more it becomes slow. Any solution for the same will be really appreciated.
Below is my sample code -
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="#{dir}/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">
<p:dataTable id="employeeTable" var="emp" value="#{bbean.employeeList}"
scrollable="true" scrollHeight="260" rowIndexVar="row">
<ui:include src="column1.xhtml" />
<ui:include src="column2.xhtml" />
<ui:include src="column3.xhtml" />
<ui:include src="column4.xhtml" />
<ui:include src="column5.xhtml" />
<ui:include src="column6.xhtml" />
<ui:include src="column7.xhtml" />
<ui:include src="column8.xhtml" />
<ui:include src="column9.xhtml" />
<ui:include src="column10.xhtml" />
<ui:include src="column11.xhtml" />
<ui:include src="column12.xhtml" />
<ui:include src="column13.xhtml" />
<ui:include src="column14.xhtml" />
<ui:include src="column15.xhtml" />
</p:dataTable>
<p:commandButton id="addButton" value="Add" process="@this"
actionListener="#{bbean.addEmployee}" oncomplete="DCVS.fn.focusOnTable('employeeTable')" />
</ui:composition>