How to enable a button when filling a textfield with VAADIN

I work with Vaadin. I have a text field and a button. My button is initially disabled. When my text field is filled with valid data my button must activate. I can not activate my button. Could you help me ? Thank you

My program that allows me to fill a valid field: “attribute” retrieves a regular expression :

public static DynTextField createFromElement(Element elt, DynForm form) {
if (elt.getNodeName().equals(“param”) && elt.getAttribute(“type”).equals(“TEXT”)) {
DynTextField dtf = new DynTextField();
if (elt.hasAttribute(“texte”))
dtf.nom = elt.getAttribute(“nom”);
if (elt.hasAttribute(“FORMAT”))
dtf.setStyleName(“param” + (elt.hasAttribute(“class”) ? elt.getAttribute(“class”) : “”));
return dtf;
} else
return null;

private void setFormat(String attribute) {
binder = new Binder<>();
binder.forField(this).withValidator(new RegexpValidator(“Saisie obligatoire !!”, attribute)).asRequired(“Format Erroné”).bind(No.getter(), No.setter());
//new Binder<>().forField(this).withValidator(new RegexpValidator(attribute, “Format Erroné”)).asRequired();


// convenience empty getter and setter implementation for better readability
public static class No {
public static <SOURCE, TARGET> ValueProvider<SOURCE, TARGET> getter() {
return source → null;

public static <BEAN, FIELDVALUE> Setter<BEAN, FIELDVALUE> setter() {
return (bean, fieldValue) → {
//no op

The program that creates my button. This is where I would like to make my button active:

public DynButton(DynForm form, String as400PGMName, String parameterList) {
this.as400PGMName = as400PGMName;
if (parameterList.length == 1 && parameterList[0]
this.parameterList = new String {};
this.parameterList = parameterList;
this.form = form;
addClickListener(event → {

impl = new DynComponentImpl();

 //boutton initially disable