Set all fields uneditable

Hey CUBA team.

I’ve got an “edit” screen that is for review only, but it’s got a whole lot of fields. I want to make these fields uneditable. Rather than setting each field as setEditable(false), I was wondering it there was a way to do this in one fall swoop, programmatically, to keep the code cleaner.

Thanks!

Hi,

You have two options:

  1. Open a screen usgin the ViewAction.
  2. Manually set screen to read-only mode, e.g. in the InitEvent handler:
@Subscribe
public void onInit(InitEvent event) {
    setReadOnly(true);
}

Regards,
Gleb

1 Like

Thank you so much, Gleb! I will add this information to my knowledge moving forward.