Refresh browse include edit window


I need refresh browse include edit window. I modify datasource in postCommit method

protected boolean postCommit(boolean committed, boolean close) {
		boolean result = super.postCommit(committed, close);
		if ((committed) && (result)) {
			LoadContext<DocTypesToLedger> lc = new LoadContext<>(DocTypesToLedger.class);
			DocTypesToLedger curritem = (DocTypesToLedger) getContext().getParams().get("ITEM");
			if (def.getValue()) {
				Integer ledgerId = curritem.getLedger().getId();
				lc.setQueryString("select r from publisher$DocTypesToLedger r where = :ledger")
						.setParameter("ledger", ledgerId);
				List<DocTypesToLedger> list = docTypesToLedgerDs.getDataSupplier().loadList(lc);
				for (DocTypesToLedger item : list) {
					if (!(item.getId().equals(curritem.getId()))) {
		return result;

I find topic abou it and I add in browse in init method refresh – > setAfterCommitHandler(entity -> docTypesToLedgersDs.refresh())

but browse doesn’t refresh.


I’ve tried to implement your idea in the CUBA Quick Start sample application, and it works: :

public class OrderBrowse extends AbstractLookup {

    private CreateAction ordersTableCreate;
    private GroupDatasource<Order, UUID> ordersDs;

    public void init(Map<String, Object> params) {
        ordersTableCreate.setAfterCommitHandler(entity -> {
            showNotification("Committed in editor", NotificationType.HUMANIZED);
} :

public class OrderEdit extends AbstractEditor<Order> {
    private Datasource<Order> orderDs;

    protected boolean postCommit(boolean committed, boolean close) {
        boolean result = super.postCommit(committed, close);
        if (committed && result) {
            LoadContext<Order> loadContext = new LoadContext<>(Order.class);
            UUID orderId = getItem().getId();
            loadContext.setQueryString("select e from sales$Order e where = :orderId")
                    .setParameter("orderId", orderId);
            Order order = orderDs.getDataSupplier().load(loadContext);
            if (order != null) {
                order.setAmount(order.getAmount().multiply(new BigDecimal(100000)));
        return result;

Here it is: (85.8 KB)

It would be helpful if you could attach a sample of your project.

I explain my problem precisely. I have edit window like this


I would like refresh documentList browse. When I create setAfterCommitHandler in this browse controler I have no effect because this code is never running, but I may create setAfterCommitHandler in Ledger editor. When I accept documentList edit window I give message committed in editor and bowser no refresh.

I see. You can use the Events mechanism.
See also:

Hi Olga.

Might I send my project to us ? I try all possibilities. I use refresh browse in other function and it’s woking ok.
I thing, It’s specific issue because browse is inner edit window.

Yes, a small sample project would be really helpful, or at least the clear explanation of your data model and the code of screen descriptors and controllers.


I attach my project. I update data in class DocTypesToLedgerEdit method postCommit and I try refresh browse in addCloseWithCommitListener in this same class. (1.1 MB)