Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

ListDataProvider refreshAll() does not update the grid

Ozkan Serin
5 years ago Apr 03, 2017 4:22pm
C. Bosch
5 years ago Apr 04, 2017 8:32am
Ozkan Serin
5 years ago Apr 04, 2017 4:14pm
C. Bosch
5 years ago Apr 04, 2017 4:23pm
Teemu Suo-Anttila
4 years ago Jul 25, 2017 1:58pm

Hi innodron,

To me the example looks like you're using a snapshot of data (service.findAll()) and store it in memory behind a ListDataProvider. Since you have a service that you use to access the backend data, I'd recommend looking at DataProvider.fromCallback . This method is used to create a DataProvider that will access your fetch and size methods when needed and the data will be more up to date. Also the refreshAll method will be quaranteed re-fetch from the backend. If you still want to keep on using data snapshots in memory, you can do grid.setItems(service.findAll()) to repopulate the Grid with the most recent snapshot. 

//Teemu