How to do a special interface ?

Hello,

I would like to create something like this :

I figured out how to do it, using several panels and sub-layouts, other sub-layouts and layouts again :

I wonder if there is a better (and easier) way to do something like this, or am I forced to use a thousand of vertical and horizontal layouts ?

Thanks !

Well, you can substitute some of those nested layouts for a GridLayout, or you can use CustomLayout. Since you have only relatively few components, the number of layouts isn’t really a problem from a performance standpoint.

I finally get it to work by using a Composite with the Visual Editor, and by using only percentages on size and position.

I know it’s a complete different question, but now I wonder if there is a way to tell the server to refresh the content of the Table every X seconds, other than creating a thread with a loop ? I’m using ServerPush Add-on to have a constant pulling system.

Updating the table contents and getting that content to the browser are two different things. To update the table data, you should use a background thread that modifies the table container. Remember to lock the application within a synchronize block whenever you do modifications from a non-Vaadin thread.

To get the content to the browser, there are two ways; one is to periodically poll the server with e.g. the Refresher add-on. Any changes made to the components are automatically sent to the client on each request. The second way is to use a Server Push tool, that pushes changes from server code directly to the browser. This is usually called in the end of the updating thread.

Which method works best for you mostly depends on how often you update the table, and if the additional overhead of the Refresher is acceptable. And finally, to answer your question, no. You have to refresh the content yourself :slight_smile: