How to jump to an already opened Screen tab

Hi team,

Need your kind advise.

I have a customed data browser page. It open data editor page in NEW_TAB.

My code for openning screen:
TailorEditor screen =screens.create(TailorEditor.class, OpenMode.NEW_WINDOW);
screen.setMessage(event.getItem().getIdentifier(),event.getItem().getCodeType().toString());
screens.show(screen);

The problem is, for the same data entry with an already opened tab, a new Tab will be opened.
Is there a way just to activate the already opened tab, and without refreshing to keep possible unsaved data?

thank you

This can be done as follows:

Class<IndividualBrowse> myScreenClass = IndividualBrowse.class;

        Optional<Screens.WindowStack> windowStack = screens.getOpenedScreens().getWorkAreaStacks().stream()
                .filter(ws -> ws.getBreadcrumbs().stream().anyMatch(screen ->
                        screen.getClass() == myScreenClass)) // also may be check screen id, see Screen#isSameScreen
                .findFirst();

        if (windowStack.isPresent()) {
            windowStack.get().select();
        } else {
            screenBuilders.screen(this)
                    .withScreenClass(myScreenClass)
                    .withOpenMode(OpenMode.NEW_TAB)
                    .show();
        }
1 Like

Exactly what i want, many thanks!!