Text field value returning Empty value on every call

Maven dependencies:
vaadin-spring 2.0.0
vaadin-server: 8.2.0
vaadin-spring-boot-starter: 1.0.0

I’m following a builder pattern for my project, But I’m running into an issue with my text fields, I’m a newbie to vaadin so any advice or relevant links will be appreciated. I started off by using the component out of the box i.e. not ValueChangeListeners, Binding. This is where I encountered the null value being returned the first time.

I then found some threads stating that I should just add a ValueChangeListeners to my text field and my trouble will be over. This did not work.

I then went on to read up on field binding and managed to manually bind my TextField and Player object, still to no avail. Te returned value is always empty. Please I have been sitting on this for a day and it is driving me crazy.

public class PlayerLayoutFactory implements UIComponentBuilder {

    private class RegisterPlayerLayout extends VerticalLayout {
        // ui objects
        TextField player1;
        Button lockPlayer1;
		Player p1 = new Player("foo");

        Binder<Player> fieldGroupP1 = new Binder<>(Player.class);

        public RegisterPlayerLayout init() {
            player1 = new TextField(BoardStringUtils.PLAYER_1.getString());

            lockPlayer1 = new Button(BoardStringUtils.LOCK.getString());

            fieldGroupP1.forField(player1).withNullRepresentation ( "" ).bind(Player::getPlayerName, Player::setPlayerName);

            return this;

        public RegisterPlayerLayout layout() {
            setComponentAlignment(player1, Alignment.MIDDLE_CENTER);
            setComponentAlignment(lockPlayer1, Alignment.TOP_CENTER);

            return this;

        public RegisterPlayerLayout setClickerListeners() {
            player1.addValueChangeListener(event -> event.getValue());
            lockPlayer1.addClickListener((ClickEvent event) -> {

                System.out.println("text: "+player1.getValue());
                if (!player1.isEmpty()) {
                } else {
                    try {
                        throw new IOException("");
                    } catch (IOException e) {


            return this;

    public Component createComponent() {
        return new RegisterPlayerLayout().init().layout().setClickerListeners();

    public Component createComponent(BoardService boardService) {
        this.boardService = boardService;
        return createComponent();