UI で <p:datatable> を使用して、jsf を使用してレコードを表示しています。[追加] ボタンをクリックすると、データ テーブルに行を追加しようとしています。[追加] ボタンをクリックすると、バッキング Bean のリストが更新され、追加の行が追加されて UI のデータ テーブルが更新されます。問題は、データ テーブルに行を追加すればするほど、処理が遅くなることです。同じことに対する解決策は本当に高く評価されます。
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>