This hacking code may work, but i am not sure it is the right way or elegant way to fix?
Could this hacking code break in the future?
By the way, just modify the Tree a bit:
Tree testTree=new Tree(){
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {
return;
}
if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
//int s = scrollPanel.getVerticalScrollPosition();
int scrollLeftInt = Window.getScrollLeft();
int scrollTopInt = Window.getScrollTop();
DOM.setStyleAttribute(this.getElement(), "position",
"fixed");
super.onBrowserEvent(event);
DOM.setStyleAttribute(this.getElement(), "position",
"static");
//scrollPanel.setVerticalScrollPosition(s);
Window.scrollTo(scrollLeftInt,scrollTopInt);
return;
}
super.onBrowserEvent(event);
}
};