Cuba 7.2 Button clickEvent and button action

Hello,
I’m using the standard viewAction to open an entity in readonly mode: as you may know, this will make the button “Enable editing” appears, and once clicked everithing in the form will be editable.
I would like to keep specific fields as editable=false.
I notice that if in the controller I use:

@Subscribe("editBtn")
public void onEditBtnClick(Button.ClickEvent event) {
    codeField.setEditable(false);
    statusField.setEditable(false);
}

this code is executed after the standard enableEditingAction, which is good, as I obtain the desired beaviour; but my question is:
is like this by design (clickEvents issued after action excecution)? or is it like this by chance (concurrent events etc…)?

By the way: is there a better alternative?

thank you

Michele

Hi,
The better way would be to override the com.haulmont.cuba.gui.screen.StandardEditor#enableEditing method, call super.enableEditing() and then make necessary adjustments in the UI.
All methods of the StandardEditor class are protected and designed for easy extension.

thank you!

Michele