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.
Best
André
krivopustov
(Konstantin Krivopustov)
June 28, 2017, 3:27am
#2
Hi Andre,
Use refresh() method of the table’s datasource. For example:
@Inject
private CollectionDatasource<MyEntity, UUID> myEntitiesDs;
public void onButtonClick() {
myEntitiesDs.refresh();
}
C.Carol
(C. C.)
October 31, 2017, 10:27am
#3
Hi,
I needed it too, but somewhy in Eclipse I got ‘Bound mismatch’ for my entity.
Here is the code:
package com.company.gdpr.web.customers;
import java.util.UUID;
import javax.inject.Inject;
import com.company.gdpr.entity.Customers;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.data.CollectionDatasource;
public class RendelkezesekBrowse extends AbstractLookup {
@Inject
private CollectionDatasource<Customers, UUID> customersDs; //Here i got for Customers
public void onRefreshBtn(Component source) {
customersDs.refresh();
}
}
Could you help me what I wrong?
Thanks
krivopustov
(Konstantin Krivopustov)
October 31, 2017, 11:28am
#4
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?
C.Carol
(C. C.)
October 31, 2017, 11:38am
#5
Sorry, RendelkezesekBrowse is CustomersBrowse, I just forgot to rename, but thanks, your answer here solved my question!
artamonov
(Yuriy Artamonov)
Split this topic
June 28, 2018, 11:07am
#6
A post was split to a new topic: How to refresh data of Table