myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Vieujot <svieu...@apache.org>
Subject New x:dataTable forceIdIndexFormula attribute
Date Sat, 06 Aug 2005 21:47:35 GMT
I finally fixed this problem.
Now, if your table's backing data collection isn't stable (changing
order, concurrent accesses), the unexpected behaviors can be fixed by
using a formula that is unique for each row in the row part of the ids.
You can for example use :
    <x:dataTable value="#{mailDAO.userInbox}" var="email"
forceIdIndexFormula="#{email.unid}"> ...

I tested it in several situations where using the default ids make the
application more than unreliable. For example :
    - A webmail where you could delete the emails right from the inbox.
Before that, if you received a new email before the post, you ended-up
deleting the email before the one you checked for deletion.
    - A data set that came unordered from the backing database. Now,
even if the order changes on each query, the update is always consistent
with the post.

Note : if unused, this attribute doesn't change the default behavior.

HTH

Sylvain.

Mime
View raw message