In Vaadin 7.0, how to refresh JavaBean data backing a Table? Replace Container? Replace Beans? -


in vaadin 7.0, when displaying javabean data in table beancontainer, proper way refresh table new data?

the table monitors the properties of items of table via listeners. if change property of item via item instance of table, table notified , updated : e.g.

container.getitem(beaninstance).getitemproperty("propertyname").setvalue("newvalue");

if, however, bean changed outside of item instance, need tell table refresh. easiest way (using stock beancontainer) remove add items.

alternatively - and, suggest, preferably - create extension of beanitemcontainer fires itemsetchange event, cause table refresh.

public class refreshablebeanitemcontainer<beantype> extends beanitemcontainer<beantype> {   public refreshablebeanitemcontainer(collection<? extends beantype> collection) throws illegalargumentexception {     super(collection);   }    public refreshablebeanitemcontainer(class<? super beantype> type) throws illegalargumentexception {     super(type);   }    public refreshablebeanitemcontainer(class<? super beantype> type, collection<? extends beantype> collection) throws illegalargumentexception {     super(type, collection);   }    public void refreshitems(){     fireitemsetchange();   } } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -