vaadin / vaadin/framework

Add getItemAt(int rowIndex) method to DataProvider

Open
#10,115 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

DataProvider lacks a method to get Nth item. The implementation should be quite straightforward, something like:

public T getItemAt(int rowIndex) {
   Query<T,SerializablePredicate<T>> query = new Query<T,SerializablePredicate<T>>(rowIndex,1,null,null,null);
   Stream<T> result = dataProvider.fetch((Query<T, SerializablePredicate<T>>) query);
   T myBean = result.findFirst().get();
   return myBean;
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the DataProvider entry point and inspect the Query and fetch APIs used in the issue description. Add the requested getItemAt(int rowIndex) behavior so it returns the item at the requested row, then verify the result with the relevant existing DataProvider tests, if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.