Cannot resolve symbol "Contact Form Event"

I am trying to follow along this tutorial: https://www.youtube.com/watch?v=bxy2JgqqKDU&ab_channel=vaadinofficial
At around 49:00 mark, we are supposed to include this code from Vaadin docs:

    public void setContact(Contact contact){
        binder.readBean(contact);
    }

    public static class SaveEvent extends ContactFormEvent {
        SaveEvent(ContactForm source, Contact contact) {
            super(source, contact);
        }
    }

    public static class DeleteEvent extends ContactFormEvent {
        DeleteEvent(ContactForm source, Contact contact) {
            super(source, contact);
        }

    }

    public static class CloseEvent extends ContactFormEvent {
        CloseEvent(ContactForm source) {
            super(source, null);
        }
    }

    public Registration addDeleteListener(ComponentEventListener<DeleteEvent> listener) {
        return addListener(DeleteEvent.class, listener);
    }

    public Registration addSaveListener(ComponentEventListener<SaveEvent> listener) {
        return addListener(SaveEvent.class, listener);
    }
    public Registration addCloseListener(ComponentEventListener<CloseEvent> listener) {
        return addListener(CloseEvent.class, listener);
    }

However, for some reason, I get the Cannot resolve symbol Contact Form Event and Type parameter 'com.example.CRMApp.views.list.ContactForm.DeleteEvent' is not within its bound; should extend 'com.vaadin.flow.component.ComponentEvent<?>' for the methods responsible for adding listeners. What could be an issue here?

The ContactFormEvent is defined in the ContactForm.java class here: flow-crm-tutorial/src/main/java/com/example/application/views/list/ContactForm.java at v24 · vaadin/flow-crm-tutorial · GitHub

It’s not a Vaadin built-in.

1 Like