selectOneMenu breaks communication with controller

I am trying to implement creating/editing/deleting Team entities, which consist of User entities. So far I have implemented deleting Teams and individual users of teams. I have added a selectOneMenu for choosing a user to add to the team, but it breaks communication with the Controller.

If I remove the selectOneMenu in line 81-83, everything works again. With it, the selectOneMenu gets populated with correct data from the controller, but all buttons which communicate with the controller stop working. I’ve checked with the debugger, none of the functions called by buttons are triggered. setuserToAdd is also not triggered by changing the selection. The Teams and Teams’ users are still displayed, so fetching data is still working.

Here is teams.xhtml:

<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:p="http://primefaces.org/ui"
            template="/WEB-INF/templates/main.xhtml">
<ui:define name ="content">


    <h:form id="userForm">
        <p:dataTable id="usersTable" var="user" value="#{teamLazyView.teamLazyDataModel}"
                     paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink}
                         {PreviousPageLink} {PageLinks} {NextPageLink}
                         {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" selectionMode="single"
                     selection="#{teamLazyView.selectedTeam}"  lazy="true">
            <p:ajax event="rowSelect" update=":userForm:userEditDialog" oncomplete="PF('userEditDialog').show()" />
            <p:column headerText="Team name" sortBy="#{user.name}" filterBy="#{user.name}">
                <h:outputText value="#{user.name}" />
            </p:column>
            <p:column style="width:100px;text-align: center">
                <p:commandButton action="#{teamLazyView.update()}" icon="ui-icon-trash"
                                 title="Delete" update=":userForm:usersTable">
                    <f:setPropertyActionListener value="#{user}" target="#{teamDetailController.team}"/>
                    <f:actionListener binding="#{teamDetailController.doDeleteTeam()}"/>
                    <p:confirm header="Confirmation"
                               message="Are you sure that you want to delete this team? You cannot undo this operation."
                               icon="ui-icon-alert"/>
                </p:commandButton>
            </p:column>
        </p:dataTable>

        <p:commandButton value="Setup Teams" action="#{teamDetailController.triggerMe()}" update=":userForm:usersTable"/>

        <p:dialog header="User Detail" id="userEditDialog" widgetVar="userEditDialog" modal="true"
                  showEffect="fade" hideEffect="fade" resizable="true" width="500">
            <p:outputPanel id="userData" style="text-align:center;">
                <h:panelGrid columns="1" rendered="#{not empty teamDetailController.team}"
                             columnClasses="label,value">

                    <p:dataList value="#{teamDetailController.teamLeader}" var="leader" type="ordered">
                        <f:facet name="header">
                            Leader of this team
                        </f:facet>
                        #{leader.username}
                    </p:dataList>

                    <p:dataTable id="membersTable" var="member" value="#{teamDetailController.teamMembers}"
                                 selection="#{userLazyView.selectedUser}"  lazy="true">
                        <p:column headerText="User name" style="width:200px;text-align: center">
                            <h:outputText value="#{member.name}" />
                        </p:column>
                        <p:column style="width:100px;text-align: center">
                            <p:commandButton action="#{teamLazyView.update()}" icon="ui-icon-trash"
                                             update="membersTable" title="Delete" >
                                <f:setPropertyActionListener value="#{member}" target="#{teamDetailController.user}"/>
                                <f:actionListener binding="#{teamDetailController.doDeleteUser()}"/>
                                <p:confirm header="Confirmation"
                                           message="Are you sure that you want to remove this user? You cannot undo this operation."
                                           icon="ui-icon-alert"/>

                            </p:commandButton>
                        </p:column>
                    </p:dataTable>



                    <p:commandButton value="Save"
                                     action="#{teamLazyView.update()}"
                                     oncomplete="PF('userEditDialog').hide()"
                                     update=":userForm:usersTable">
                        <f:actionListener binding="#{teamDetailController.doSaveTeam()}"/>
                    </p:commandButton>

                </h:panelGrid>

                <h:panelGrid columns="2"
                             columnClasses="label,value">

                    <p:outputLabel value="Select User: "/>
                    <h:selectOneMenu value = "#{teamDetailController.userToAdd}">
                        <f:selectItems value="#{teamDetailController.potentialUsers}" var="member" itemValue="#{member.name}" />
                    </h:selectOneMenu>

                    <p:commandButton value="Add User" action="#{teamDetailController.doAddUser()}" update="membersTable"/>

                </h:panelGrid>

            </p:outputPanel>

            <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" width="300">
                <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
            </p:confirmDialog>
        </p:dialog>

    </h:form>


</ui:define>

Here is an image of it rendered: https://i.imgur.com/prCFQeH.png

Here is TeamDetailController.java:

@Component
@Scope("application")
public class TeamDetailController implements Serializable {

@Autowired
private UserService userService;

@Autowired
private AuditLogService auditLogService;

private Team team;
private ArrayList<User> TeamMembers;
private User TeamLeader;

private User user;
private User userToAdd;

private ArrayList<User> potentialUsers;

/**
 * Sets the currently displayed team and reloads it form db. This team is
 * targeted by any further calls of
 * {@link #doReloadTeam()}, {@link #doSaveTeam()} and
 * {@link #doDeleteTeam()}.
 *
 * @param team
 */
public void setTeam(Team team) {
    this.team = team;
    this.TeamMembers = userService.getTeamMembers(team);
    this.TeamLeader = team.getLeader();
    doReloadTeam();
}



/**
 * Action to force a reload of the currently displayed team.
 */
public void doReloadTeam() {
    team = userService.loadTeam(team.getName());
    this.TeamMembers = userService.getTeamMembers(team);
    this.TeamLeader = team.getLeader();
}

/**
 * Action to save the currently displayed team.
 */
public void doSaveTeam() {
    team = this.userService.saveTeam(team);
    this.TeamMembers = userService.getTeamMembers(team);
    this.TeamLeader = team.getLeader();
}

/**
 * Action to delete the currently displayed team.
 */
public void doDeleteTeam() {
    this.userService.deleteTeam(team);
    team = null;
}

/**
 * Action to delete the currently displayed team.
 */
public void doDeleteUser() {
    team.remove(user);
    doSaveTeam();
    doReloadTeam();
}

public void doAddUser() {
    team.add(userToAdd);
    doSaveTeam();
    doReloadTeam();
}

public ArrayList<User> getPotentialUsers() {

    ArrayList<User> temp = new ArrayList<User>(userService.getAllUsers());
    for(int i = temp.size() - 1; i >= 0; i--){
        if(temp.get(i).getRole() != UserRole.EMPLOYEE && temp.get(i).getRole() != UserRole.TEAM_LEADER){
            temp.remove(i);
        }
    }
    return temp;
}

/**
 * Returns the currently displayed team.
 *
 * @return
 */
public Team getTeam() {
    return team;
}

public ArrayList<User> getTeamMembers() {
    return TeamMembers;
}

public void setTeamMembers(ArrayList<User> teamMembers) {
    TeamMembers = teamMembers;
}

public User getUser() {
    return user;
}

public void setUser(User user) {
    this.user = user;
}

public User getTeamLeader() {
    return TeamLeader;
}

public void setTeamLeader(User teamLeader) {
    TeamLeader = teamLeader;
}

public User getUserToAdd() {
    return userToAdd;
}

public void setUserToAdd(User userToAdd) {
    this.userToAdd = userToAdd;
}

public void setPotentialUsers(ArrayList<User> potentialUsers) {
    this.potentialUsers = potentialUsers;
}

}