How to set StatusHandler programmatically?

JmixComboBox test = new JmixComboBox();
test.setStatusChangeHandler( ???? ) 

private void comboBoxTestStatusChangeHandler(final SupportsStatusChangeHandler.StatusContext statusContext) {

}

How to set the comboBoxTestStatusChangeHandler programmatically ?

Sorry, I am nearly sure, some people smile; but I don’t get it ;/

Regards

Felix

Hello Felix!

You should use Method Reference:

@Autowired
private UiComponents uiComponents;

@Subscribe
public void onInit(InitEvent event) {
    JmixComboBox<String> test = uiComponents.create(JmixComboBox.class);
    test.setStatusChangeHandler(this::comboBoxTestStatusChangeHandler);
}
private void comboBoxTestStatusChangeHandler(final SupportsStatusChangeHandler.StatusContext<JmixComboBox<String>> statusContext) {

}

For more detailed information please refer to the Oracle tutorial: Method References.

Hi Roman

Basics … Thank you.

The classical tree in the forest; did search ways to far.

Best regards

Felix