User default screen - error on AbstractEditor

Hi,

After set the default screen for the user as the entity editor (AbstractEditor), after logging in I get a login error (red frame with information). There is no additional information in the log file.
After clicking on the notification, the login was successful, but the default screen was not opened.
This is not happening on the screen type: AbstractLookup.

Regards
Marcin

I found exception message (I overwrited login screen and showUnhandledExceptionOnLogin method).

Can’t find action windowCommit. This may happen if you are opening an AbstractEditor-based screen by openWindow() method, for example from the main menu.
Use openEditor() method or give the screen a name ended with ‘.edit’ to open it as editor from the main menu.

Solution:

Replace existing bean: WebWindowManager

1). create new custom WebWindowManager

public class CustomWebWindowManager extends WebWindowManager {

    private static final Logger log = LoggerFactory.getLogger(CustomWebWindowManager.class);

    public static final Pattern ENTITY_SCREEN_PATTERN = Pattern.compile("([_A-Za-z]+\\$[A-Z][_A-Za-z0-9]*)\\.(.+)");

    @Inject
    protected Metadata metadata;

    @Inject
    public CustomWebWindowManager() {
        super();
    }

    @Override
    public void openDefaultScreen() {
        String defaultScreenId = webConfig.getDefaultScreenId();

        if (webConfig.getUserCanChooseDefaultScreen()) {
            String userDefaultScreen = userSettingService.loadSetting(ClientType.WEB, "userDefaultScreen");
            defaultScreenId = StringUtils.isEmpty(userDefaultScreen) ? defaultScreenId : userDefaultScreen;
        }

        if (StringUtils.isEmpty(defaultScreenId)) {
            return;
        }

        if (!windowConfig.hasWindow(defaultScreenId)) {
            log.info("Can't find default screen: {}", defaultScreenId);
            return;
        }

        MetaClass metaClass = null;
        String windowType = null;

        Matcher matcher = ENTITY_SCREEN_PATTERN.matcher(defaultScreenId);
        if (matcher.matches()) {
            metaClass = metadata.getClass(matcher.group(1));
            windowType = matcher.group(2);
        }

        WindowInfo windowInfo = windowConfig.getWindowInfo(defaultScreenId);
        Window window = null;

        if (windowType.equals("edit")) {
            Entity entity = metadata.create(metaClass);
            window = openEditor(windowInfo, entity, WindowManager.OpenType.NEW_TAB);
        } else {
            window = openWindow(windowInfo, WindowManager.OpenType.NEW_TAB);
        }

        // in case of window is created by Runnable instance
        if (window == null) {
            return;
        }

        if (!webConfig.getDefaultScreenCanBeClosed()) {
            WebAppWorkArea workArea = getConfiguredWorkArea(createWorkAreaContext(window));
            if (workArea.getMode() == Mode.TABBED) {
                TabSheetBehaviour tabSheetBehaviour = workArea.getTabbedWindowContainer()
                        .getTabSheetBehaviour();

                HasComponents tabLayout = WebComponentsHelper.getComposition(window).getParent();
                String tabId = tabSheetBehaviour.getTab(tabLayout);

                tabSheetBehaviour.setTabClosable(tabId, false);
            }
        }
    }

}

2). add to web-spring.xml

<bean id="cuba_WebWindowManager" class="com.company.app.web.managers.CustomWebWindowManager" scope="prototype"/>