Showing new screen from modal screen - User Registration Sample

Hello CUBA team!

I’m altering the user registration sample project to require the user to check his/her email to activate the account. One simple step that isn’t working as required is showing the “Check your email” screen I’ve created as a blank screen. The Register screen is a modal, and I’m attempting to redirect from it as a full screen:

try {
                registrationService.registerUser(getFirstName(), getLastName(), getOrganization(), getPhoneNumber(), getEmail(), getLogin(), getPassword(), getConfirmPassword());

                CheckEmailScreen checkEmailScreen = screens.create(CheckEmailScreen.class);
                        .withCaption("Created user " + getLogin())

            } catch (MethodParametersValidationException e) {
                List<String> messages = e.getConstraintViolations().stream()
                String message = Joiner.on("\n").join(messages);

This opens the new CheckEmailScreen in a modal as well. I’m hoping to discover a way to redirect from the registration modal to the new screen in a full window (check-email-screen.xml) which shows the message. Any ideas?

Thanks in advance. You all are great!


That is correct, screens opened from a modal window also force modal. But you can show your screen in maximized mode with no resize possible, simply add the following settings to your screen XML:

<dialogMode maximized="true" resizable="false"/>

Alternatively, you can add the following annotation to your screen controller:

@DialogMode(windowMode = DialogWindow.WindowMode.MAXIMIZED, resizable = false)


1 Like