How to make synchronize scroll between two table in vaadin 7?

I have two table in vaadin. One is as Table mainTable. Another is ScrollTable freezeTable. I need a synchronize scroll between two table. If i will scroll mainTable vertically the freezeTable should scroll as same but in case of horizontal scroll I don’t want any synchronize scroll. I got some idea from vaadin forum like belows. But I am unable to proceed because of some deprecated method.

In MyViewPage.java I am adding this two table as addComponent(loadTables()); public HorizontalSplitPanel loadTables(){ final HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); Table mainTable = new Table(); ScrollTable freezeTable=new ScrollTable(); freezeTable.setDependentTable( mainTable ); freezeTable.setWidth( "300px" ); mainTable.setWidth( "800px" ); freezeTable.setContainerDataSource(myContainer); freezeTable.setVisibleColumns(viscol); freezeTable.setColumnHeaders(vishead); freezeTable.setPageLength(15); mainTable.setContainerDataSource(myAnotherContainer); mainTable.setVisibleColumns(viscolmain); mainTable.setColumnHeaders(visheadmain); mainTable.setPageLength(15); splitPanel.setFirstComponent(freezeTable); splitPanel.setSecondComponent(mainTable); return splitPanel; } ScrollTable class is like this.


ScrollTable.java

package com.abhiram.app.myproject.freezetable; import com.vaadin.data.Container; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.shared.ui.Connect; import com.vaadin.ui.Table; @SuppressWarnings("serial") public class ScrollTable extends Table{ private Table mainTable; public ScrollTable() { super(); } public void setDependentTable( Table mainTable) { this.mainTable= mainTable; } @Override public void paintContent( PaintTarget target ) throws PaintException { target.addAttribute( "scrollPane", this ); if ( table != null ) target.addAttribute( "dependentTable", mainTable); super.paintContent( target ); } } I have created another class VMyScrollTable and extend VScrollTable like this.


VMyScrollTable.java

package com.abhiram.app.myproject.freezetable.client.ui; import com.google.gwt.event.dom.client.ScrollEvent; import com.google.gwt.event.dom.client.ScrollHandler; import com.abhiram.app.myproject.freezetable.ScrollTable; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.UIDL; import com.vaadin.client.ui.FocusableScrollPanel; import com.vaadin.client.ui.VScrollTable; import com.vaadin.shared.ui.Connect; @Connect(com.abhiram.app.myproject.freezetable.ScrollTable.class) public class VMyScrollTable extends VScrollTable{ public VMyScrollTable() { super(); } @Override public void updateFromUIDL( final UIDL uidl, final ApplicationConnection client ) { super.updateFromUIDL(uidl,client ); final String tableId = uidl.getStringAttribute( "dependentTable" ); if ( tableId == null ) return; String id = uidl.getStringAttribute( "scrollPane" ); VScrollTable scrollPane = (VScrollTable) client.getPaintable(id); final FocusableScrollPanel scrollBody = (FocusableScrollPanel) scrollPane.getWidget(1); scrollBody.addScrollHandler( new ScrollHandler() { @Override public void onScroll( ScrollEvent event ) { VMyScrollTable.this.onScroll( event ); VScrollTable dependentPane = (VScrollTable) client.getPaintable(tableId ); FocusableScrollPanel scrollToBeBody = (FocusableScrollPanel) dependentPane.getWidget( 1 ); scrollToBeBody.setScrollPosition( scrollBody.getScrollPosition() ); } }); } } Here problem is
VScrollTable
class have no method like
updateFromUIDL(…)
and
ApplicationConnection
have no method like
getPaintable(String)
. I am unable to proceed because of this. Any thing need to change in my code?? Please any body help me how to do this.

Is there a solution for this?

Yes,
I have the updated freeze table. You can use it. Use the
extfilteringtable
addon.