Binding a Container to a table and updating Table from Container

Hello everyone. I am a new user to Vaadin and I like what I see so far.

Right now I am trying to develop a web application that contains a table. Each row in the table references a specific object and needs to show live (or close to live) statistics about it. I am having trouble wrapping my head around the property, item, container model that Vaadin uses. If I understand it right I think it should work out perfectly, but I just can’t seem to get anything to work.

How do I get the table to update when a value changes in the object? Right now the only way I can get it to update is by refreshing the browser or clicking on one of the table headers to call a re-sort.

You need to know which applications are listening to your objects. For each application (http session) that needs to update, use the ICEPush add-on to tell it to refresh. You need some kind of listening mechanism to register your applications with your data model.

This is the simplest approch (pushing is a one-line Java statement). If many objects change all at once, you may want to refresh less frequently than on every change.

I started thinking about this myself. having a table with say 20 rows and 5 properties means that you have a 100 fields that keep refreshing itself. Having a few users watching the table at the same time and you’re pretty close to have created an DDoS attack on your own server :slight_smile:

Of course I could be wrong about the amount of data / users / refresh rate, but I’d probably say that the Refresher is more appropriate in this case. Just put it to refresh once a second and it should be working pretty well. Then again, the ICEPush is better if the refresh rate is more like once a minute.

That is a good idea because I have new information coming in very fast. It would bring a server to it’s knees. I’m looking into the refresher now. How do I tell the refresher to refresh my table? Or does it refresh everything?

Refresher will refresh everything. Everything depends on the rate at which updates occur. If they are bursty (long period without much) you keep polling for nothing. If the bursts are dense (several updates together) you are better off polling.

Thank you both very much. This answered all of my questions.