Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
scroll in table
it's possible to associate listener to scroll in the table?
As I understand, in the current implementation vaadin library, this is impossible
table.setContainerDataSource(new Container(0, 20));
table.addActionHandler(new Action.Handler() {
public Action[] getActions(Object target, Object sender) {
LOGGER.info("target " + target);
if (markedRows.contains(target)) {
return ACTIONS_MARKED;
} else {
LOGGER.info("he");
return ACTIONS_UNMARKED;
}
}
public void handleAction(Action action, Object sender, Object target) {
LOGGER.info("anskjanzkjsnzkajnsk", action + " " + sender + " " + target);
if (ACTION_MARK == action) {
markedRows.add(target);
table.refreshRowCache();
LOGGER.info("ACTION_MARK" + ACTION_MARK);
} else if (ACTION_UNMARK == action) {
markedRows.remove(target);
table.refreshRowCache();
LOGGER.info("ACTION_UNMARK" + ACTION_UNMARK);
} else if (ACTION_LOG == action) {
Item item = table.getItem(target);
addComponent(new Label("Saved: " + target + ", "
+ item.getItemProperty(ExampleUtil.iso3166_PROPERTY_NAME).getValue()));
}
}
});
Actions are not related to scrolling, they are used to create a context menus and keyboard shortcuts. If you need scrolling information to handle lazy-loading of rows, you should use a container that does the lazy loading.
In vaadin sapmler, is noted that table can implement lazy loading: Table supports lazy-loading, which means that the content is loaded from the server only when needed. This allows the table to stay efficient even when scrolling hundreds of thousands of rows.
that is a link:http://demo.vaadin.com/sampler#TableLazyLoading