Multiuser work with the Vaadin table

With one table several operators are working, and always have to show up to date. I do this by clicking on the line -

table.addListener(new Table.ValueChangeListener() {
            public void valueChange(final event) {

   BeanItemContainer<Incoming> bic;
   Query query = sess.createQuery("....");
   List l = query.....
   bic = new BeanItemContainer<Incoming>(l);


But when I load -


Selected line
is lost
What to do in this case? I would be grateful for the information!

Thank you!

This is because the Table clears its value when changing the container; there are no guarantees that the old value will still exist in the table. You can fix this by temporarily storing the value:

Object oldVal=table.getValue();

Make sure that the class of oldVal has proper equals() and hashcode() implementations, otherwise the above won’t work.

Thanks for the answer, Thomas Mattsson! :smiley: