Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How to refresh Grid after deleting item
In an attempt to delete a row I am performing the following:
complexGrid.getContainerDataSource().removeItem(itemId);
However after deletion the Grid does not refresh to reflect the deletion.
This technique appears to work in a Button renderer but not otherwise.
Any help would be appreciated.
I mean com.vaadin.data.Container implementation.
Also please open a browser console and ensure if there are no errors.
com.vaadin.data.util.BeanItemContainer
extending
com.vaadin.data.util.AbstractBeanContainer
If I find errors in my console I will post them, thanks!
Thank you for your help, I found an answer.
Rather than using:
Grid.getContainerDataSource().removeItem(itemId);
or
complexGrid.getContainerDataSource().removeAllItems();
I tried:
complexes = new ArrayList<>();Grid.setContainerDataSource(new BeanItemContainer<>(ComplexModuleData.class, complexes));
The API related to removing Items did not return the appropriate results, but the API concerning setting the container data source to a null ArrayList did.
Thanks for your help and attention.
Hi, Please any one help me out on below when i delete a single row in grid formate the item was deleted, but need to immediate changes on grid without refresh page
new_grid.addThemeVariants(GridVariant.LUMO_ROW_STRIPES);
Column<AddQty> equipment = new_grid.addColumn(AddQty::getEquipName).setHeader("Equipments").setResizable(true);
Column<AddQty> equipment_specification = new_grid.addColumn(AddQty::getTxttitle)
.setHeader("Equipment Specifications").setResizable(true);
Column<AddQty> description_col = new_grid.addColumn(AddQty::getDescription).setHeader("Descriptions").setResizable(true);
new_grid.addColumn(new ComponentRenderer<>(item -> {
Button delete_Btn = new Button("");
delete_Btn.setIcon(new Icon(VaadinIcon.ARROWS_CROSS));
delete_Btn.addThemeVariants(ButtonVariant.LUMO_ERROR);
delete_Btn.setWidth("100%");
delete_Btn.addClickListener(ev -> {
rep.deleteDescription(item.getTxttitle());
new_grid.getColumns();
new_grid.setItems(add_modal);
update();
});
return delete_Btn;
}));
//Query on repo class
@Query(value = "delete from add_descriptions where txttitle = :title", nativeQuery = true)
public void deleteDescription(String title);
Any help would be Appreciate