Thank you.I had to play with a class that implements listlistener, 
tabelviewlistener and tableviewselectionlistener, so i could keep track of 
selection history. It's working now :)

----- Mail original -----

De: "Chris Bartlett" <[email protected]>
À: [email protected]
Envoyé: Mercredi 16 Novembre 2011 19:23:44
Objet: Re: Keeping track of selected items during a refresh

On 16 November 2011 15:53, David Delbecq <[email protected]> wrote:
> Hello,
>
> i have the following procedure in place in a pivot application:
>
> a tableview is populated using Node extends List<Node>. Each node has
> several properties (name, date ...) . One of them is a read only unique id
> (named etag). One of the operations i make requires me to issue a clear() on
> the List<Node> immediately followed by a repopulation. I'd like all my
> tableviews (and possibly any other related view using the list) to
> automatically reselect the Nodes having same ETags as those that were
> selected before the reloading. Is there any way to achieve this? Some kind
> of listener in TableView where i could be notified the selection has changed
> because of a list reloading?
>
> Thank you.
>

You can add a listener that can perform an action when the TableView's
entire data source changes.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/TableViewListener.html#tableDataChanged(org.apache.pivot.wtk.TableView,
org.apache.pivot.collections.List)

That might add/remove a ListListener to the List<Node> which will
handle the reselection side of things.
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/collections/ListListener.html

Reply via email to