How to manually trigger post create logic for adding an item to browse screen

I have a typical browse screen with the accompanying editor screen. When you create an item by clicking the create button and then saving it in the editor the item is aded to the top of the browse screen. this is default cuba behaviour.

I now have an extra button that will launch a custom “wizard” screen. In this screen the user can select a number of values and based on these values and historical data I will create a new instance.

After the users clicks ok in the custom screen, I create and save a new entity in the backend and then open the standard editor screen populated for this entity.

When the user clicks ok in this screen, he automatically retursn to the browser screen.

But now the entity is not added to the table. How could i do this?

my browse screen

    @Subscribe(id = "dossiersTable.wizard")
    public void openWizardScreen(Action.ActionPerformedEvent event) {
        screenBuilders.editor(CreateDossier.class, this).build().show();
    }

my wizard screen

    @Subscribe("createNewDosier")
    public void onCreateNewDosier(Action.ActionPerformedEvent event) {
        Id<Dossier, UUID> id = createDossierService.createNewDossier(getEditedEntity());
        Dossier dossier = dataManager.load(id).view(Views.DOSSIER_VIEW.getView()).one();
        screenBuilders.editor(Dossier.class, this).editEntity(dossier).withOpenMode(OpenMode.NEW_TAB).show();
        this.closeWithDiscard();
    }

Hi,
If you have access to the instance of editor Screen, and to the collection container associated with table where the item should be added to - this is the code:

        CardEdit cardEdit = screens.create(CardEdit.class);

        cardEdit.addAfterCloseListener(e -> {
            cardsDc.getMutableItems().add(cardEdit.getEditedEntity());
        });
        cardEdit.show();