I have a Custom component with a textField and a button, I want to onClick (of the Button), get the text from the textField and call another Component.
The error I get when I call mainLayout.addComponent(new A(textField.getValue()); is an
java.lang.IllegalStateException: Composition root must be set to non-null value before the com.example.vaadpro.
As the exception says, you have to call setCompositionRoot for your CustomComponent: