Infinite scrolling generic component
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
With the new data provider and query callbacks, Grid and ComboBox had become very powerful components when dealing with a backend datasource with a huge number of items.
It would be really great then to have an extendable generic component to extend which provides an easy interface to the infinite scrolling behavior, without dealing with design context and connectors.
Something to use like this:
public class ListComponent<T> extends InfiniteScrolling<T> {
public ListComponent(ComponentContainer root) {
this.setDesignRoot(root);
this.addNewItemsListener(event -> {
event.getItems().forEach(item -> {
root.addComponent(this.itemComponentGenerator.apply(item));
});
});
}
}
ListComponent<Issue> issueList = new ListComponent<>(new VerticalLayout());
issueList.setDataProvider(issueBackendDataProvider);
issueList.setItemComponentGenerator(issue -> {
HorizontalLayout issueLayout = new HorizontalLayout();
// ...
return issueLayout;
});
and have the InfiniteScrolling handle data provider querying and sorting and filtering when necessary.
This would permit to build list views like GitHub's issues:
or StackOverflow's tag list:
(I know they use pagination, so the component might have the user choose if use pagination or infinite scrolling).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Grid and ComboBox data-provider, query-callback, sorting, and filtering behavior. Then clarify the API and scope for a generic component supporting item generation and either infinite scrolling or pagination. Done should include a documented, extendable component with examples covering the proposed list-view use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100