This is the culprit: rendered="#{mb.rsTelxSett.count > 0}"
Please use the renderedIfEmpty attribute instead:Excerpt from the TLD:
8X-------------------------------------------------------
<attribute>
<name>renderedIfEmpty</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
Indicates whether this table should be rendered if the underlying DataModel is
empty.
You could as well use rendered="#{not empty bean.list}", but this one causes
the getList method of your model bean beeing called up to five times per
request, which is not optimal when the list is backed by a DB table.
Using renderedIfEmpty="false" solves this problem, because the MyFaces
extended HtmlDataTable automatically caches the DataModel and calles the
model getter only once per request.
Default: true
</description>
</attribute>
8X-------------------------------------------------------
HTH, Manfred
Francesco Consumi wrote:
Scrive Manfred Geiler <[EMAIL PROTECTED]>:
Francesco, Just place your "populate()" call into your getList method, use the <x:dataTable> instead of <h:dataTable>, set the "preserveData" attribute to true and lean back. ;-) There is some (not yet neatly documented) magic inside the extended data table that makes the component do call your getList method only once per request.
Thanks, but I'm sorry to inform you that even if I use x:dataTable, the "getList" method is being called at least 8 (eight) times....
here is the dataTable code:
"result" is the ArrayList populated. I've to populate it at every page request
because its query depends on some parameters that the user can select in form
in order to filter result set.
<x:dataTable var="g" value="#{mb.rsTelxSett.result}" styleClass="standardTable" headerClass="standardTable_SortHeader" footerClass="standardTable_Footer"
columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnRight,standardTable_ColumnRight"
rendered="#{mb.rsTelxSett.count > 0}" preserveDataModel="true"> <f:facet name="header"> <h:panelGroup> <h:outputText value="Statistiche telefono"/> </h:panelGroup> </f:facet> <h:column id="c0"> <f:facet name="header"><h:outputText value="Utente" id="h0"/></f:facet> <h:outputText value="#{g.COGNOMENOME}" id="c1Text0"/> </h:column> <h:column id="c1"> <f:facet name="header"><h:outputText value="Codice" id="h1"/></f:facet> <h:outputText value="#{g.CODICE}" id="c1Text"/> </h:column> <h:column id="c2"> <f:facet name="header"><h:outputText value="Centro di Costo" id="h2"/></f:facet> <h:outputText value="#{g.NOME}" id="c1Text2"/> </h:column> <h:column id="c3"> <f:facet name="header"><h:outputText value="Scatti" id="h3"/></f:facet> <h:outputText value="#{g.TOT}" id="c1Text3"/> </h:column> <h:column id="c4"> <f:facet name="header"><h:outputText value="Costo totale" id="h4"/></f:facet> <h:outputText value="#{g.COSTOTOT}" id="c1Text4"> <f:convertNumber type="currency"/> </h:outputText> </h:column> </x:dataTable>
many thanks for support.
-- Francesco Consumi Ufficio Sistemi informativi Istituto degli Innocenti Piazza SS.Annunziata, 12 50122 Firenze consumi at istitutodeglinnocenti.it Tel. +39 055 2037320 ICQ# 12516133

