Events fired when screens.showFromNavigation(screen) is used


I have got an application that has a search list page and and a detail page for the items form the list. The items within the search list page are rendered by fragments. The app allows to select an item from the list and to jump into the detail page and vice versa. For user convenience I want to display the result page in the same way as it was shown before the user jumped to the detail page.

So it is needed to bring the last selected item into focus when the user jumps back. Therefor I use a button and the function:


To be able to focus the last selected element I need an event that is fired within the page when it will be shown again. I tested onBeforeShow, onAfterShow events, but these events are not fired. Is there another way to get noticed when the page is shown again?

The window mode is SINGLE.

Thanks for any tipps


I guess that you open the detail screen programmatically, so the easiest solution is to subscribe to the close event of the screen that you open, e.g.:

public void onBtnClick(Button.ClickEvent event) {
            .withAfterCloseListener(screenCloseEvent ->
                            .withCaption("Screen closed")


1 Like