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.
HTH, Manfred
Francesco Consumi wrote:
Hi people,
I've some doubt about the best way of populating a result set:
<h:dataTable value="#{bean.List}"...../>
I've a dataTable linked to an ArrayList. I populate the array list with result
of a query.
what do you think is the best place to place call to "populate()" method ?
if I put that call in "getList" method of bean, the populate() is being called a
lot of times. If I call it once in bean() main procedure, the result is not kept
up to date.
thanks,
-- Francesco Consumi Ufficio Sistemi informativi Istituto degli Innocenti Piazza SS.Annunziata, 12 50122 Firenze consumi at istitutodeglinnocenti.it Tel. +39 055 2037320 ICQ# 12516133

