Grid and lazy loading (Vaadin 7.4)

Hi,

I’ve been playing with Grid (Vaadin 7.4.0 beta 1) for three days and have some questions:

  1. I created 1 million records in my container data source but the Grid only loaded 880,000 of them. I noticed that Table used to have similar issues to pick up up to 800,000 records due to browser limitations. Does Grid have the issue too?

  2. I was trying to simulate my use case where data source requested record data only when necessary and data was returned lazily. However Grid neither pick up the change automatically nor got refreshed when I called markAsDirty() when data was loaded. I’m not sure if it’s because I did something wrong. When Vaadin says Grid supports lazy loading, does it mean:
    a) javascript ← lazy loading → java
    or
    b) javascript ↔ java ← lazy loading → Whatever data store
    ?

  3. I tried to find some tutorials or sample code or documentation on the internet regarding Grid and lazy loading, but I couldn’t find any. Do you guys have any documentation or example on how lazy loading works and how to implement it with Grid?

Your answer will be appreciated.

Thanks!

Hi,

The grid does lazy loading between the browser and your server. Whether or not you have lazy loading between your java code and the data store depends on the Container implementation you are using. Containers like IndexedContainer and BeanItemContainer are in memory, whereas containers like SQLContainer and JPAContainer delegate the data loading to the underlying datasource. There are many more containers in the directory, and you can also implement your own if you have some very unique data source. The LazyQueryContainer addon makes it fairly straight forward to hook up pretty much any datasource.

Hi; I’m starting to get interested on this.

I’m using Grid everywhere and my containers are SQLContainer. Some queries have a lot of JOINs or come from prepared statements, and other are simpler but there are tens of thousands rows there, so in the 1st case it takes a lot to load even if there are a few cent rows and in the second one loading happens almost instantly, but when you scroll down to let’s see the middle of the Grid, it gets stuck forever.

I would like to improve these situations, but by “delegate the data loading to the underlying datasource” I understand that everything is left to the postgres engine I’m using in my case. So in the end there is nothing I can do?

Ok, I finally opened a thread for this:


https://vaadin.com/forum#!/thread/16170167

it’s a bug in SQLContainer and it’s been well known for almost 5 years:


https://vaadin.com/forum#!/thread/1938138

Unfortunately, the Vaadin staff did nothing to solve it (althought patches have been proposed) and SQLContainer it deprecated now.