Open Editor Screen in main screen workArea from browse displayed as dialog

I would like to open an editor screen as a tab of the workArea in the main screen. I have tried to change the openMode to NEW_TAB but that does not seem to work. No matter what i have tried it always opens from the browse screen forced as dialog in another dialog.

How can I open the editor screen from the browse screen( forceDialog=“true” ) in the main workArea?

Thx,
Eric

Hi Eric. Thank you for your question!

In your case, you won’t be able to open the edit screen in the NEW_TAB mode.
This made by design. There were several reasons for its introduction.

The first reason is the inability to navigate to the previous screen.The state of the previous screen will be lost. The navigation chain will also break.

The second reason.
With this type of screen opening, the previous dialog will remain open on top of the workArea.

Regards,
Dmitriy

Thanks for that info. Makes sense.

I was able to get this to work. Here is what i did.
I created a Class implementing MenuItemRunnable that displays the lookup with a withSelectHandler that gets the entity to edit and then creates the editor using the FrameOwner origin parameter to the run method in the interface. Works exactly as i had hoped. Just needed to break the link between the browse and the edit screens.

Here is the code:

 @Override
    public void run(FrameOwner origin, MenuItem menuItem) {

        screenBuilders.lookup(Ceoi.class, origin)
                .withSelectHandler(ceois -> {
                    Ceoi ceoi = ceois.iterator().next();

                    screenBuilders.editor(Ceoi.class, origin)
                            .editEntity(ceoi)
                            .withOpenMode(OpenMode.NEW_TAB)
                            .build()
                            .show();
                }).withOpenMode(OpenMode.DIALOG)
                .build()
                .show();
    }
4 Likes