It seems like one way to update JavaBean data is to replace the Table Container with another container. One side effect that I noticed is that some table parameters can be reset, for example, collapsed columns are no longer reset.
Another way is to save the container when replacing the contained Beans.
I am not sure that both of these approaches are considered correct. And I'm not sure what trade-offs may be for any of these approaches.
Here is an example application with a pair of tables and a button. When the user clicks the button, both tables receive new data. One table gets a new BeanContainer. Another table stores its BeanContainer, but loads the new beans.

Just two classes in this application:
- The main class of the application.
- The JavaBean class used to store data.
package com.example.replacebeansorcontainer; import java.util.ArrayList; import java.util.List; import java.util.UUID; import com.vaadin.data.util.BeanContainer; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Table; import com.vaadin.ui.UI; @SuppressWarnings( "serial" ) public class ReplaceBeansOrContainerUI extends UI { Table tableThatGetsFreshContainer; Table tableThatGetsFreshBeans; @Override protected void init( VaadinRequest request ) {
JavaBean Class ...
package com.example.replacebeansorcontainer; import java.text.SimpleDateFormat; import java.util.UUID; public class MomentBean {
source share