How to refresh dataloaders for new entities on windowcommit

I have a windowcommit handler that reloads some of the ui because i have dynamic settings there.

    public void onAfterInit(AfterInitEvent event) {
        addAfterCommitChangesListener(e -> reloadUi());

    public void reloadUi() {

I have a save button and the listener is correctly called. If I do this for an already existing entity everything works.

For newly created entities the getScreenData().loadAll() just keeps the in memory object, it doesnt go to the db to get the latest version. Should I do something special the first time the object is actually going to be persisted to associate it with the dataloader?


Hi Tom,

Indeed the loader does nothing after saving a new entity because it has no entity id assigned. The following should work:

private InstanceLoader<Foo> fooDl;

public void reloadUi() {

Perhaps this should be done by the framework. Created issue: Set in StandardEditor after saving new entity · Issue #3153 · cuba-platform/cuba · GitHub


1 Like