Right to left layout

Hi
For some languages we need right to left layout for whole screen. Is it possible to change the layout? VAADIN itself supports rtl.

Hi,

Current Jmix UI module is based on Vaadin 8, which doesn’t support RTL. I suppose that you’re talking about Vaadin 23 and currently, we’re developing a new UI module based on Vaadin 23 which has support for RTL mode out of a box (see vaadin doc).

Regards,
Gleb

Thanks! that is great news. Do you have any estimate when new UI module would be available?

Regards

Jmix 1.3 includes the preview version of the new UI (see what’s new section). The final version will be available later this year.

Thanks Gleb,I tested, but it didn’t have support for right-to-left.

Below works for me:

@Route(value = "login")
@UiController("login-view")
@UiDescriptor("login-view.xml")
public class LoginView extends StandardView {
...
    public LoginView() {
        UI.getCurrent()
                .setDirection(Direction.RIGHT_TO_LEFT);
    }
...
}

Result
Screenshot 2022-07-20 at 17.45.24
Screenshot 2022-07-20 at 17.46.37

1 Like

Thanks Gleb, It looks fantastic! Is there anyway to turn it on for the whole application according to user’s selected language?

There is no language selection functionality on the Login View for now, it will be implemented later, but it can be added manually if it is needed.

This code changes UI direction for the entire application:

UI.getCurrent().setDirection(Direction.RIGHT_TO_LEFT);