EntityPicker and EntityOpenAction in readonly mode jmix 2

Hi all,

in jmix 2, is it possible to enable entityOpenAction for an EntityPicker in read only mode?

Hi,

Currently, you can use the following code:

@ViewComponent
private EntityPicker<User> userPicker;

@Autowired
private DialogWindows dialogWindows;

@Subscribe("userPicker.open")
public void onUserPickerOpen(final ActionPerformedEvent event) {
    DialogWindow<View<?>> dialogWindow = dialogWindows.detail(userPicker)
            .build();

    if (dialogWindow.getView() instanceof ReadOnlyAwareView readOnlyAwareView) {
        readOnlyAwareView.setReadOnly(true);
    }

    dialogWindow.open();
}

It’ll be easier in future when this issue will be implemented.

Regards,
Gleb