Search code examples
vaadindeclarativejmix

vaadin declarative, how to get the java instance of TextField


I am new with declarative UI in vaadin, how to get the java instance like TextField that was declare in xml ?

I want to set value to it. not found how to get it.


Solution

  • With the @Id annotation

    @Id("my-textfield")
    private TextField myTextfield;
    

    Please read the documentation:

    https://vaadin.com/docs/latest/flow/templates/components