Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF + primefaces calling getter way too much times
    primarykey
    data
    text
    <p>I read all answers on this topic (not only) on SO, but none of this solves my problem. I have datatable:</p> <pre><code>&lt;p:dataTable value="#{reportBean.reportData.rows}" var="row" styleClass="listBlock dataTableOverflowAuto fullScreenTable" rendered="#{!reportBean.reportData.grouped}"&gt; &lt;f:facet name="header"&gt; #{msg['report.table.header']} &lt;/f:facet&gt; &lt;p:column&gt; #{row.integrationName} &lt;/p:column&gt; &lt;p:column&gt; #{row.integrationId} &lt;/p:column&gt; &lt;p:column&gt; #{row.service} &lt;/p:column&gt; &lt;p:columns value="#{reportBean.reportData.columns}" var="column"&gt; &lt;f:facet name="header"&gt; #{column} &lt;/f:facet&gt; &lt;h:outputText value="#{row.getData(column)}" escape="false" /&gt; &lt;/p:columns&gt; </code></pre> <p>getReportData() on reportBean is very simple (no calculation):</p> <pre><code>public ReportDataInterface getReportData() { return reportData; } </code></pre> <p>And the data returned are:</p> <pre><code>public class NoneGroupedReportData implements ReportDataInterface { private int counter = 0; Logger logger = LoggerFactory.getLogger(getClass()); private List&lt;String&gt; columns = new LinkedList&lt;String&gt;(); public void addRow(Row row) { addColumns(row); } public List&lt;String&gt; getColumns() { counter++; logger.debug("getColumns called {} times", counter); return columns; } .... </code></pre> <p>And the result is </p> <blockquote> <p>2013-05-15 07:38:07,405 () DEBUG NoneGroupedReportData - getColumns called 21600 times</p> </blockquote> <p>For dataTable with ~30 rows and 10 columns.</p> <p>I know why JSF calls getters many times, but almost 22k, why? When i need more results (>1000) it will not render in 5 minutes, because it endlessly calls this getter. Where is the problem and how can i achieve the state in which getColumns() is called for each row max 5~10 times? </p> <p>I have tried using jstl c:set "caching" but without any result (<a href="http://qussay.com/2013/04/19/caching-and-reusing-an-evaluated-el-expression-in-jsf/" rel="nofollow">http://qussay.com/2013/04/19/caching-and-reusing-an-evaluated-el-expression-in-jsf/</a>)</p> <p>EDIT: My guess is that getter calling is not "wrong" but sign that i am using dataTable in the wrong way. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload