TreeTable - dynamic change and refresh

Hi,
I’m trying to get dynamic updates to a TreeTable. I have a Poll Indicator running as well so that, as the changes are CSS, they will just appear.
I get the data to change by resetting a displayed property. alternately I have tried refreshRowCache.
Everything works fine unless… if you close/open anywhere on the TreeTable even relatively slowly (I’ve actually been doing it around the actual item that I expect to change) I nearly always get another copy of the child row appear. This doesn’t clear even when the client refreshes? The duplicate row copies the ‘proper’ row, for example, if use the collapse arrow.
If you collapse the parent however, the duplicate isn’t removed and clicking on it causes an Internal Server error part of which is here…
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:324)
at com.vaadin.ui.TreeTable$HierarchicalStrategy.getIdByIndex(TreeTable.java:289)
at com.vaadin.ui.TreeTable.getIdByIndex(TreeTable.java:593)
at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:1753)
at com.vaadin.ui.Table.getVisibleCellsUpdateCacheRows(Table.java:1580)
at com.vaadin.ui.Table.paintPartialRowUpdates(Table.java:2749)
at com.vaadin.ui.Table.paintPartialRowUpdate(Table.java:2733)
at com.vaadin.ui.Table.paintContent(Table.java:2681)
at com.vaadin.ui.TreeTable.paintContent(TreeTable.java:474)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:781)
I’m using 6.7.5
Is there a ‘safe’ way of doing this? before you answer…
I don’t want to delete and add items as I’m using fiilters. It works fine without them but I can’t for the life of me get it to work with…
Trying to ‘stop’ the user interacting with the component while it is updating would also be not really viable.
Cheers,
Richard

Okay, I’ve simplified as much as possible. not rocket science but hopefully you get the idea.
Open and close Level 1 repeatedly to get the error…

import java.util.Collection;
import java.util.Iterator;

import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.TreeTable;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Runo;

public class AppMain extends Application implements Runnable {

   private Thread thread;
   TreeTable treet;

@Override
public void init() {
	

    setTheme(Runo.themeName());

    VerticalLayout root = new VerticalLayout();
    root.setMargin(true);
    root.setSizeFull();
    Window main = new Window("Test", root);
    setMainWindow(main);
    HorizontalLayout blah = new HorizontalLayout();
    root.addComponent(blah);
    treet = new TreeTable();
    treet.setImmediate(true);
    treet.setHeight("290px");
    treet.setWidth("300px");
    treet.addContainerProperty("Name", String.class, "");
	treet.addContainerProperty("ID", String.class, "");
	Object Level1 = treet.addItem(new Object[] { "Level1", "1"}, null);
	Object Level2 = treet.addItem(new Object[] { "Level2","2"}, null);
	Object Level3 = treet.addItem(new Object[] { "Level3","3"}, null);
	treet.setParent(Level3,Level2);
	treet.setParent(Level2,Level1);
	
	blah.addComponent(treet);
	

	thread = new Thread(this);
	thread.start();
   

}

@Override
public void close() {
    super.close();
}

public void run() {
	Object obj12;
	Item ite1;
	while (true) {
		try {
			thread.sleep(5000);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		Collection <?> coll = treet.getItemIds();
		Iterator fit = coll.iterator();
		while(fit.hasNext()) {
			  obj12 = fit.next(); 
			  ite1 = treet.getItem(obj12);
			  if (ite1.getItemProperty("Name").toString().equals("Level2")) {
				  ite1.getItemProperty("Name").setValue("Changed");
			  }
		}
		try {
			thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}

}

okay. lot of aggro but I did it with remove and insert.
just went straight into the TreeTable and hoped it would work regardless of filters.
save the old item item. remove it. add in with changed value using the old item id.
luckily sort is fixed so no worries there. seems to work ok but is slightly slow.