Does someone knows how to get Vaadin TableConnector in Cuba Platform?
I want to be able to scroll two table at the same time.
If I scroll the table on the left side I want the table on the right side to be scrolled accordingly.
How can I archive this in CUBA? The example below is copied from Stackoverflow. Here they shows an example working directly with vaadin Table.
@Connect(ScrollTable.class)
public class ScrollTableConnector extends TableConnector implements
ScrollHandler {
private VScrollTable dependentPane = null;
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
String tableId = uidl.getStringAttribute("dependentTable");
if (tableId == null) {
return;
}
if (dependentPane == null) {
FocusableScrollPanel scrollBody = (FocusableScrollPanel) getWidget()
.getWidget(1);
scrollBody.addScrollHandler(this);
}
dependentPane = ((TableConnector) client.getConnector(tableId, 0))
.getWidget();
}
@Override
public void onScroll(ScrollEvent event) {
FocusableScrollPanel scrollBody = (FocusableScrollPanel) getWidget()
.getWidget(1);
FocusableScrollPanel scrollToBeBody = (FocusableScrollPanel) dependentPane
.getWidget(1);
scrollToBeBody.setScrollPosition(scrollBody.getScrollPosition());
}
}