Filter the background screen list based on selection on popup

I have a browse screen and it list all data when opened
If a specific id is not there in sessionDataProvider like
Integer id= (Integer) sessionDataProvider.getObject().getAttribute(“id”);
if(id== null) {
screens.create(chooseEntity.class).show();
}

This open a popup with a dropdown to chose entity. When an entity is selected and the popup is closed i need to filter the browse screen according to the selcted entity

In short how can i get the selected value in popup in the screen from which i opened the popup

Use screenBuilders instead of screens.

screenBuilders.screen(this)
            .withScreenClass(chooseEntity.class)
            .withAfterCloseListener(e -> {
                //somehow take the selection result from your popup-screen
            })
            .build()
            .show();

But I don’t know how your chooseEntity works.
So I can’t exactly describe how to get the selection result from your screen.

See also Executing Code after Close and Returning Values.

@krivopustov @andrey_vb
Thanks it worked