Something is messed up with ui binder and browser session

given the following class:

I’m getting a strange behavior when i click on the add button, which the fields in the dialog are already populated with values even though i would expect them to be empty.
BUT, if I open chrome in incognito mode, clicking add does bring up a dialog with empty fields, why?

public class UserListView extends VerticalLayout {

    private final Grid<UserData> userDataGrid = new Grid<>(UserData.class, false);
    private static final Logger logger = LoggerFactory.getLogger(UserListView.class);;
    public UserListView() {
        userDataGrid.addColumn(UserData::getUserName).setHeader("User Name").setAutoWidth(true);
        userDataGrid.addColumn(UserData::getUserType).setHeader("User Type").setAutoWidth(true);
        final SingleSelect<Grid<UserData>, UserData> userSelect = userDataGrid.asSingleSelect();
        final HorizontalLayout buttons = getUserActions(userSelect);

        add(userDataGrid, buttons);

            final List<UserData> userData = userService.getUserData();


    private HorizontalLayout getUserActions(SingleSelect<Grid<UserData>, UserData> userSelect) {
        final Button add = new Button("Add", (ComponentEventListener<ClickEvent<Button>>) event -> {
            final UserData userData1 = new UserData();
        final Button edit = new Button("Edit", (ComponentEventListener<ClickEvent<Button>>) event -> {
        final Button delete = new Button("Delete", (ComponentEventListener<ClickEvent<Button>>) event -> {
            final ConfirmDialog dialog = new ConfirmDialog("Delete User", "Are you sure you want to permanently delete this user?", "Delete"
                 , new ComponentEventListener<ConfirmDialog.ConfirmEvent>() {
                public void onComponentEvent(ConfirmDialog.ConfirmEvent event) {
          "Delete user");
            }, "Cancel", new ComponentEventListener<ConfirmDialog.CancelEvent>() {
                public void onComponentEvent(ConfirmDialog.CancelEvent event) {
          "Canceled Delete user");
        final HorizontalLayout buttons = new HorizontalLayout(add, edit, delete);
        return buttons;

    private void createUserDialog(UserData userData1) {
        final TextField userName = new TextField("User Name","");
        final PasswordField passwordField = new PasswordField("Password");
        final Binder<UserData> userDataBinder = new Binder<>();
        userDataBinder.forField(userName).bind(UserData::getUserName, UserData::setUserName);
        userDataBinder.forField(passwordField).bind(UserData::getPassword, UserData::setPassword);
        final Dialog userDataDialog = new Dialog("User Data");
        final Button ok = new Button("OK", (ComponentEventListener<ClickEvent<Button>>) event1 -> {

            try {
            } catch (ValidationException e) {
                throw new RuntimeException(e);
        final Button cancel = new Button("Cancel", (ComponentEventListener<ClickEvent<Button>>) event -> userDataDialog.close());
        final VerticalLayout verticalLayout = new VerticalLayout(userName, passwordField);


If you are talking about chrome pre-filling your username / password - the most obvious thing to be pre-filled; you are correct, chrome does that. Incognito mode won’t.

1 Like

OH lol it worked way too smoothly to even suspect that, is there a way to prevent auto-fill from doing that in that particular form? cause it doesn’t make sense when adding a NEW user. .

well i’ve placed autoComplete off, but it’s still pops up the form with default value as before.

You not gonna like that answer. Chrome is special :slightly_smiling_face:

thanks, you might wanna add some notes to vaadin’s javadocs about it…