RE: Navigate to next Item

Which Vaadin version you use?


I have following situation:

I have two views. The first one is an view with a Grid, which shows all items of an entity. When I click on one of those items I navigate to the second view, where the user can edit this item.

My question is now, how can I navigate from there to the next item, which was listed in the Grid before? I would like to navigate through all items on the second view.

Thanks for any advise.

Sorry for the late answer. I have Vaadin version 8. But I already solved it by my own.

I save all Items in a List and with the current object, I can get the index of the position of this object in the List. The next and the previous object is easy to access then.

List<Applicant> applicants = service.findAll();
int size = applicants.size();
int index = applicants.indexOf(applicant);
prevId = applicants.get(index-1).getId();
nextId = applicants.get(index+1).getId();