I have a windowcommit handler that reloads some of the ui because i have dynamic settings there.
@Subscribe
public void onAfterInit(AfterInitEvent event) {
addAfterCommitChangesListener(e -> reloadUi());
}
public void reloadUi() {
getScreenData().loadAll();
setEditable(invoiceService.canEdit(getEditedEntity()));
}
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?
regards,
Tom