Remove table item(row data)

Hello all,

How to remove table item (row data) with button click (button stores out of table )
if I have an item ID?
I’ve tried to remove with removeItem() and getItemId().remove() methods, but doesn’t work.
I’m a new in vaadin and need your help please.
Could someone help me?
Thanks in advance.

Remove the ItemId from the Container:

protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
final Table table = new Table();

    final BeanItemContainer<Data> bic = new BeanItemContainer<Data>(Data.class);
    bic.addBean(new Data(1, "Tester"));
    bic.addBean(new Data(2, "SecondTester"));
    Button button = new Button("Click Me");
    button.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            //This is the selected ItemId
            Data data = (Data) table.getValue();
             //Removing the ItemId from the Container automaticly updates the Table


//Sample Data Bean
public class Data {
private Integer id;
private String name;

    public Data(Integer id, String name) { = id; = name;

    public Integer getId() {
        return id;

    public void setId(Integer id) { = id;

    public String getName() {
        return name;

    public void setName(String name) { = name;

Thank you very much for your help.