Refresh table after inserting value in database

Hi. How can I update a table right after inserting some rows inthe database? I need to update the table after the user inserts somes values By pressing a button. I am aware of the Timer component but what I really need is a way to refresh the table.



Hi Andre,

Use refresh() method of the table’s datasource. For example:

private CollectionDatasource<MyEntity, UUID> myEntitiesDs;

public void onButtonClick() {


I needed it too, but somewhy in Eclipse I got ‘Bound mismatch’ for my entity.

Here is the code:


import java.util.UUID;

import javax.inject.Inject;

import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Component;

public class RendelkezesekBrowse extends AbstractLookup {
	private CollectionDatasource<Customers, UUID> customersDs; //Here i got for Customers

    public void onRefreshBtn(Component source) {

Could you help me what I wrong?

Please provide XML descriptor of the RendelkezesekBrowse screen, at least in the part where customersDs is defined. Also, what is the base class of the Customers entity?

Sorry, RendelkezesekBrowse is CustomersBrowse, I just forgot to rename, but thanks, your answer here solved my question!

A post was split to a new topic: How to refresh data of Table