Crud addNewListener, save button is not activated by default

I am overriding the addNewListener of my Crud component to generate random data for the form component values, with the goal of easier testing. The technique is documented here: https://vaadin.com/docs/latest/components/crud#item-initialization

I am supplying all form components with a value, however the ‘Save’ button is not automatically activated. It stays grey until i go into one of the form fields and make a change. Enabling the button from the listener has no effect, crud.getSaveButton().setEnabled(true); . Is there a way to programmatically enable it ? You can reproduce the behaviour on above link.

Well, crud.getSaveButton().setEnabled(true) from outside the listener works. It’s a bit counterintuitive as i’m enabling the button away from the location where i’m generating random data. Is there a way to enable it from the listener still ?

crud.setDirty(true) from the listener works, found it via a javadoc reference on the getSaveButton method.